コード例 #1
0
 @Test
 public void toLong() throws Exception {
   assertThat(RubyUtils.toLong(null)).isNull();
   assertThat(RubyUtils.toLong(2)).isEqualTo(2L);
   assertThat(RubyUtils.toLong(3L)).isEqualTo(3L);
   assertThat(RubyUtils.toLong("4")).isEqualTo(4L);
 }
コード例 #2
0
  @Test
  public void toLong_unexpected_class() throws Exception {
    throwable.expect(IllegalArgumentException.class);

    RubyUtils.toLong(false);
  }