diff options
Diffstat (limited to 'spec/ruby/core/unboundmethod/bind_call_spec.rb')
-rw-r--r-- | spec/ruby/core/unboundmethod/bind_call_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/unboundmethod/bind_call_spec.rb b/spec/ruby/core/unboundmethod/bind_call_spec.rb index 8f25f8bd0d..80b2095d86 100644 --- a/spec/ruby/core/unboundmethod/bind_call_spec.rb +++ b/spec/ruby/core/unboundmethod/bind_call_spec.rb @@ -7,6 +7,8 @@ describe "UnboundMethod#bind_call" do @parent_um = UnboundMethodSpecs::Parent.new.method(:foo).unbind @child1_um = UnboundMethodSpecs::Child1.new.method(:foo).unbind @child2_um = UnboundMethodSpecs::Child2.new.method(:foo).unbind + @normal_um_super = UnboundMethodSpecs::Mod.instance_method(:foo_super) + @parent_um_super = UnboundMethodSpecs::Parent.new.method(:foo_super).unbind end it "raises TypeError if object is not kind_of? the Module the method defined in" do @@ -47,4 +49,10 @@ describe "UnboundMethod#bind_call" do um = p.method(:singleton_method).unbind ->{ um.bind_call(other) }.should raise_error(TypeError) end + + it "allows calling super for module methods bound to hierarchies that do not already have that module" do + p = UnboundMethodSpecs::Parent.new + + @normal_um_super.bind_call(p).should == true + end end |