|
35 | 35 |
|
36 | 36 | @method_one = UnboundMethodSpecs::Methods.instance_method(:one) |
37 | 37 | @method_two = UnboundMethodSpecs::Methods.instance_method(:two) |
| 38 | + |
| 39 | + @mixin = UnboundMethodSpecs::Mixin.instance_method(:mixin_method) |
| 40 | + @includer_base = UnboundMethodSpecs::IncluderBase.new.method(:mixin_method).unbind |
| 41 | + @includer_child = UnboundMethodSpecs::IncluderChild.new.method(:mixin_method).unbind |
| 42 | + @extender_base = UnboundMethodSpecs::ExtenderBase.method(:mixin_method).unbind |
| 43 | + @extender_child = UnboundMethodSpecs::ExtenderChild.method(:mixin_method).unbind |
38 | 44 | end |
39 | 45 |
|
40 | 46 | it "returns true if objects refer to the same method" do |
|
91 | 97 | (@includer == @includee).should == true |
92 | 98 | end |
93 | 99 |
|
| 100 | + ruby_bug "#21873", ""..."4.0" do |
| 101 | + it "returns true if same method is present in an object through module inclusion" do |
| 102 | + (@mixin == @includer_base).should == true |
| 103 | + (@includer_base == @mixin).should == true |
| 104 | + |
| 105 | + (@mixin == @includer_child).should == true |
| 106 | + (@includer_child == @mixin).should == true |
| 107 | + |
| 108 | + (@includer_base == @includer_child).should == true |
| 109 | + (@includer_child == @includer_base).should == true |
| 110 | + end |
| 111 | + |
| 112 | + it "returns true if same method is present in an object through module extension" do |
| 113 | + (@mixin == @extender_base).should == true |
| 114 | + (@extender_base == @mixin).should == true |
| 115 | + |
| 116 | + (@mixin == @extender_child).should == true |
| 117 | + (@extender_child == @mixin).should == true |
| 118 | + |
| 119 | + (@extender_base == @extender_child).should == true |
| 120 | + (@extender_child == @extender_base).should == true |
| 121 | + end |
| 122 | + end |
| 123 | + |
94 | 124 | it "returns false if both have same Module, same name, identical body but not the same" do |
95 | 125 | class UnboundMethodSpecs::Methods |
96 | 126 | def discard_1; :discard; end |
|
0 commit comments