Skip to content

Commit

Permalink
Add specs for prepended module method ownership (one failing).
Browse files Browse the repository at this point in the history
  • Loading branch information
jemc committed Apr 30, 2015
1 parent 546cef5 commit d30a820
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/core/module/prepend_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ def self.prepend_features(mod)
Class.new { prepend(m) }.ancestors.should include(m)
end

it "reports the prepended module as the method owner" do
m = Module.new { def meth; end }
c = Class.new { def meth; end; prepend m }
c.new.method(:meth).owner.should == m
end

it "reports the prepended module as the unbound method owner" do
m = Module.new { def meth; end }
c = Class.new { def meth; end; prepend m }
c.instance_method(:meth).owner.should == m
end

it "sees an instance of a prepended class as kind of the prepended module" do
m = Module.new
c = Class.new { prepend(m) }
Expand Down
1 change: 1 addition & 0 deletions spec/tags/ruby/core/module/prepend_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:Module#prepend reports the prepended module as the unbound method owner

0 comments on commit d30a820

Please sign in to comment.