summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-08 15:23:46 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-06 01:15:45 +0900
commitceb9d516c6d17b0619cf53dfba7cb7b29fe073e4 (patch)
treed888fc8896a20b212eb7bd96cf3962db488baafe /test
parentd69510b6cda4024237de8f5766d85397abd5e434 (diff)
[ruby/bigdecimal] Undef BigDecimal#initialize_copy
Both BigDecimal#clone and BigDecimal#dup return self, there is no reason to have initialize_copy exposed as a Ruby method. The same is true for initialize_clone and initialize_dup. https://github.com/ruby/bigdecimal/commit/aaf237fa9e
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3295
Diffstat (limited to 'test')
-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 4598936b9a..6928834907 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -1876,6 +1876,12 @@ class TestBigDecimal < Test::Unit::TestCase
EOS
end
+ def test_no_initialize_copy
+ assert_equal(false, BigDecimal(1).respond_to?(:initialize_copy, true))
+ assert_equal(false, BigDecimal(1).respond_to?(:initialize_dup, true))
+ assert_equal(false, BigDecimal(1).respond_to?(:initialize_clone, true))
+ end
+
def assert_no_memory_leak(code, *rest, **opt)
code = "8.times {20_000.times {begin #{code}; rescue NoMemoryError; end}; GC.start}"
super(["-rbigdecimal"],