File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,34 @@ def baz(a)
153153 end
154154 end
155155
156+ module MultiSuperTargets
157+ module M
158+ def foo
159+ super
160+ end
161+ end
162+
163+ class BaseA
164+ def foo
165+ :BaseA
166+ end
167+ end
168+
169+ class BaseB
170+ def foo
171+ :BaseB
172+ end
173+ end
174+
175+ class A < BaseA
176+ include M
177+ end
178+
179+ class B < BaseB
180+ include M
181+ end
182+ end
183+
156184 module MS3
157185 module ModA
158186 def foo ( a )
Original file line number Diff line number Diff line change 3939 Super ::MS2 ::C . new . foo ( [ ] ) . should == [ "ModB#foo" , "C#baz" , "A#baz" ]
4040 end
4141
42+ it "can resolve to different methods in an included module method" do
43+ Super ::MultiSuperTargets ::A . new . foo . should == :BaseA
44+ Super ::MultiSuperTargets ::B . new . foo . should == :BaseB
45+ end
46+
4247 it "searches class methods including modules" do
4348 Super ::MS3 ::A . new . foo ( [ ] ) . should == [ "A#foo" ]
4449 Super ::MS3 ::A . foo ( [ ] ) . should == [ "ModA#foo" ]
You can’t perform that action at this time.
0 commit comments