From 7e21b77dc6bfefaf331a0dbf89782303b8cda05d Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Thu, 18 Feb 2021 17:10:39 +0900 Subject: T#dup (T < Proc) should return T's object T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9. [Bug #17545] --- test/ruby/test_proc.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3