summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-02-18 17:10:39 +0900
committerKoichi Sasada <ko1@atdot.net>2022-01-13 17:43:14 +0900
commit7e21b77dc6bfefaf331a0dbf89782303b8cda05d (patch)
tree53de2f22527722e03837f2528448293dfe840e7a /test/ruby
parent5a75151a0166ded78fc87ef5891a6877ba0950db (diff)
T#dup (T < Proc) should return T's object
T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9. [Bug #17545]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4197
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_proc.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 05b2493b24..392b6be665 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -412,6 +412,11 @@ class TestProc < Test::Unit::TestCase
assert_equal(:foo, bc.foo)
end
+ def test_dup_subclass
+ c1 = Class.new(Proc)
+ assert_equal c1, c1.new{}.dup.class, '[Bug #17545]'
+ end
+
def test_binding
b = proc {|x, y, z| proc {}.binding }.call(1, 2, 3)
class << b; attr_accessor :foo; end