Skip to content

Commit

Permalink
Super from a class method must work with prepended modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius authored and eregon committed Oct 28, 2015
1 parent 591ff4f commit 8aa7b1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/module/fixtures/classes.rb
Expand Up @@ -509,6 +509,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
Expand Down
6 changes: 6 additions & 0 deletions core/module/prepend_spec.rb
Expand Up @@ -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
end
end

0 comments on commit 8aa7b1e

Please sign in to comment.