diff options
Diffstat (limited to 'spec/ruby/core/unboundmethod/owner_spec.rb')
| -rw-r--r-- | spec/ruby/core/unboundmethod/owner_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/ruby/core/unboundmethod/owner_spec.rb b/spec/ruby/core/unboundmethod/owner_spec.rb index 165b175147..b099c56de1 100644 --- a/spec/ruby/core/unboundmethod/owner_spec.rb +++ b/spec/ruby/core/unboundmethod/owner_spec.rb @@ -1,5 +1,6 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' +require_relative '../method/fixtures/classes' describe "UnboundMethod#owner" do it "returns the owner of the method" do @@ -23,4 +24,8 @@ describe "UnboundMethod#owner" do child_singleton_class.instance_method(:class_method).owner.should == parent_singleton_class child_singleton_class.instance_method(:another_class_method).owner.should == child_singleton_class end + + it "returns the class on which public was called for a private method in ancestor" do + MethodSpecs::InheritedMethods::C.instance_method(:derp).owner.should == MethodSpecs::InheritedMethods::C + end end |
