aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-29 04:32:20 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-29 04:32:20 +0000
commitfed832d7f29a9d30b3af9afbe5ab10e515d253e5 (patch)
tree675a5e02620cd6539eaa962c36196657557b05d0 /test/bigdecimal
parent98d7c2b8f186bb1b036f531465a1e5b006922102 (diff)
downloadruby-fed832d7f29a9d30b3af9afbe5ab10e515d253e5.tar.gz
* ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode):
return the result of a block. * test/bigdecimal/test_bigdecimal.rb (test_save_rounding_mode): add a test for the above change. * test/bigdecimal/test_bigdecimal.rb (test_save_exception_mode): add a test for the return value of BigDecimal.save_exception_mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 9f66a7940f..e8fed1661b 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -112,6 +112,8 @@ class TestBigDecimal < Test::Unit::TestCase
BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN)
end
assert_equal(BigDecimal::ROUND_HALF_EVEN, BigDecimal.mode(BigDecimal::ROUND_MODE))
+
+ assert_equal(42, BigDecimal.save_exception_mode { 42 })
end
def test_save_rounding_mode
@@ -120,6 +122,8 @@ class TestBigDecimal < Test::Unit::TestCase
BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN)
end
assert_equal(BigDecimal::ROUND_FLOOR, BigDecimal.mode(BigDecimal::ROUND_MODE))
+
+ assert_equal(42, BigDecimal.save_rounding_mode { 42 })
end
def test_save_limit