summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-09 14:10:04 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-06 01:15:46 +0900
commit6607212224401d852c0056b841be7ff95236e8f7 (patch)
tree4b9e7843e79b1400677bcebccb4e55ab7fbfaabb
parentd36b197d7c1ce5684fb215697dc2d404cbd730d0 (diff)
[ruby/bigdecimal] Make tests pass on Ruby 2.4
https://github.com/ruby/bigdecimal/commit/9d19e842ee
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3295
-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 874338b..0a190d2 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -1887,9 +1887,10 @@ class TestBigDecimal < Test::Unit::TestCase
def test_initialize_copy_dup_clone_frozen_error
bd = BigDecimal(1)
bd2 = BigDecimal(2)
- assert_raise(FrozenError) { bd.send(:initialize_copy, bd2) }
- assert_raise(FrozenError) { bd.send(:initialize_clone, bd2) }
- assert_raise(FrozenError) { bd.send(:initialize_dup, bd2) }
+ err = RUBY_VERSION >= '2.5' ? FrozenError : TypeError
+ assert_raise(err) { bd.send(:initialize_copy, bd2) }
+ assert_raise(err) { bd.send(:initialize_clone, bd2) }
+ assert_raise(err) { bd.send(:initialize_dup, bd2) }
end
def assert_no_memory_leak(code, *rest, **opt)