aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-19 17:38:18 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-19 17:38:18 +0000
commit971a57004e346d87c7f0f55d16f1abb66fe24451 (patch)
treeb9d054de8151f72ca7b74fa72a918d6716ffc2a3 /test/bigdecimal
parentac69adf5dea3b6b0b3df34db73cc2255fb481aa0 (diff)
downloadruby-971a57004e346d87c7f0f55d16f1abb66fe24451.tar.gz
* ext/bigdecimal/bigdecimal.c (check_rounding_mode, BigDecimal_mode):
raise ArgumentError instead of TypeError passing invalid modes. * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round): change against the above modifications. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 351fd2dbab..9f66a7940f 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -53,8 +53,9 @@ class TestBigDecimal < Test::Unit::TestCase
end
def test_mode
- assert_raise(TypeError) { BigDecimal.mode(BigDecimal::EXCEPTION_ALL, 1) }
- assert_raise(TypeError) { BigDecimal.mode(BigDecimal::ROUND_MODE, 256) }
+ assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::EXCEPTION_ALL, 1) }
+ assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::ROUND_MODE, 256) }
+ assert_raise(ArgumentError) { BigDecimal.mode(BigDecimal::ROUND_MODE, :xyzzy) }
assert_raise(TypeError) { BigDecimal.mode(0xf000, true) }
begin
@@ -632,7 +633,7 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal(2, x.round(0, BigDecimal::ROUND_HALF_EVEN))
assert_equal(3, x.round(0, BigDecimal::ROUND_CEILING))
assert_equal(2, x.round(0, BigDecimal::ROUND_FLOOR))
- assert_raise(TypeError) { x.round(0, 256) }
+ assert_raise(ArgumentError) { x.round(0, 256) }
ROUNDING_MODE_MAP.each do |const, sym|
assert_equal(x.round(0, const), x.round(0, sym))