|
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 |
|
110 | 116 | end |
111 | 117 | end |
112 | 118 |
|
| 119 | + ruby_bug "#21873", ""..."3.4" do |
| 120 | + it "returns true if same method is present in an object through module inclusion" do |
| 121 | + (@mixin == @includer_base).should == true |
| 122 | + (@includer_base == @mixin).should == true |
| 123 | + |
| 124 | + (@mixin == @includer_child).should == true |
| 125 | + (@includer_child == @mixin).should == true |
| 126 | + |
| 127 | + (@includer_base == @includer_child).should == true |
| 128 | + (@includer_child == @includer_base).should == true |
| 129 | + end |
| 130 | + |
| 131 | + it "returns true if same method is present in an object through module extension" do |
| 132 | + (@mixin == @extender_base).should == true |
| 133 | + (@extender_base == @mixin).should == true |
| 134 | + |
| 135 | + (@mixin == @extender_child).should == true |
| 136 | + (@extender_child == @mixin).should == true |
| 137 | + |
| 138 | + (@extender_base == @extender_child).should == true |
| 139 | + (@extender_child == @extender_base).should == true |
| 140 | + end |
| 141 | + end |
| 142 | + |
113 | 143 | it "returns false if both have same Module, same name, identical body but not the same" do |
114 | 144 | class UnboundMethodSpecs::Methods |
115 | 145 | def discard_1; :discard; end |
|
0 commit comments