Skip to content

Commit

Permalink
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/ruby/core/module/fixtures/classes.rb
Original file line number Diff line number Diff line change
@@ -504,6 +504,14 @@ def self.get_constant_from_scope_with_send(method)
send(method, "Lookup")
end
end

class SuperInClassMethodWithPrepend
def self.inherited(base)
super
end
end

SuperInClassMethodWithPrepend.singleton_class.prepend(Module.new)
end

class Object
6 changes: 6 additions & 0 deletions spec/ruby/core/module/prepend_spec.rb
Original file line number Diff line number Diff line change
@@ -287,4 +287,10 @@ class ModuleSpecs::PrependSuperInSingletonClass
end
end.should_not raise_error
end

it "supports super when the module is prepended into a singleton class with a class super" do
lambda do
Class.new(ModuleSpecs::SuperInClassMethodWithPrepend)
end.should_not raise_error

This comment has been minimized.

Copy link
@eregon

eregon Oct 14, 2015

Member

@headius Generally I try to avoid should_not raise_error as it is a rather weak matcher (for instance it would just work if the impl did erroneous behavior but happened to not throw anything). I fixed it in 26c4d68 by just checking the base value of the included hook.

This comment has been minimized.

Copy link
@headius

headius Oct 14, 2015

Author Member

Actually, I was just following the pattern you did in 79ce276 :-) But yes, I agree...actually tracking something positive is better.

This comment has been minimized.

Copy link
@headius

headius Oct 14, 2015

Author Member

Ahh actually, I don't know who did that original change... 79ce276 is just the squashed commit. Could even have been me!

This comment has been minimized.

Copy link
@eregon

eregon Oct 14, 2015

Member

Indeed :) ruby/spec@6209f82
(the squash commit is to avoid replicating the rubyspec history too much in jruby)

end
end

0 comments on commit 6a52113

Please sign in to comment.