summaryrefslogtreecommitdiff
path: root/test/bigdecimal/test_bigdecimal.rb
diff options
context:
space:
mode:
authorheadius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 05:31:00 +0000
committerheadius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 05:31:00 +0000
commit787b98e365e597e1ba8e9ec9b53fecb7f03688eb (patch)
treef89fe957e7b23f58cc124cc30920dc55ddcbc212 /test/bigdecimal/test_bigdecimal.rb
parentd21daa2b9132f5208f09dcd4ea37efd8d81c9d04 (diff)
* 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
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 02bb5a5..23c540b 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)