aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/method/to_proc_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/method/to_proc_spec.rb')
-rw-r--r--spec/ruby/core/method/to_proc_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/method/to_proc_spec.rb b/spec/ruby/core/method/to_proc_spec.rb
index 92bd64aaf1..29b7bec2b3 100644
--- a/spec/ruby/core/method/to_proc_spec.rb
+++ b/spec/ruby/core/method/to_proc_spec.rb
@@ -90,4 +90,15 @@ describe "Method#to_proc" do
array.each(&obj)
ScratchPad.recorded.should == [[1, 2]]
end
+
+ it "returns a proc that properly invokes module methods with super" do
+ m1 = Module.new { def foo(ary); ary << :m1; end; }
+ m2 = Module.new { def foo(ary = []); super(ary); ary << :m2; end; }
+ c2 = Class.new do
+ include m1
+ include m2
+ end
+
+ c2.new.method(:foo).to_proc.call.should == %i[m1 m2]
+ end
end