diff options
author | headius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-13 05:31:00 +0000 |
---|---|---|
committer | headius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-13 05:31:00 +0000 |
commit | 787b98e365e597e1ba8e9ec9b53fecb7f03688eb (patch) | |
tree | f89fe957e7b23f58cc124cc30920dc55ddcbc212 | |
parent | d21daa2b9132f5208f09dcd4ea37efd8d81c9d04 (diff) | |
download | ruby-787b98e365e597e1ba8e9ec9b53fecb7f03688eb.tar.gz |
* test/bigdecimal/test_bigdecimal.rb: Add test for mult by nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 02bb5a5175..23c540b338 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -694,6 +694,12 @@ class TestBigDecimal < Test::Unit::TestCase assert_kind_of(BigDecimal, BigDecimal.new("3") * 1.quo(3)) end + def test_mult_with_nil + assert_raise(TypeError) { + BigDecimal('1.1') * nil + } + end + def test_div x = BigDecimal.new((2**100).to_s) assert_equal(BigDecimal.new((2**100 / 3).to_s), (x / 3).to_i) |