summaryrefslogtreecommitdiff
path: root/spec/ruby/core/method/owner_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/method/owner_spec.rb')
-rw-r--r--spec/ruby/core/method/owner_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/core/method/owner_spec.rb b/spec/ruby/core/method/owner_spec.rb
index 3378b7bd1f..1cdc4edfa7 100644
--- a/spec/ruby/core/method/owner_spec.rb
+++ b/spec/ruby/core/method/owner_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "Method#owner" do
it "returns the owner of the method" do
@@ -23,4 +23,8 @@ describe "Method#owner" do
@m.method(:handled_via_method_missing).owner.should == MethodSpecs::Methods
end
end
+
+ it "returns the class on which public was called for a private method in ancestor" do
+ MethodSpecs::InheritedMethods::C.new.method(:derp).owner.should == MethodSpecs::InheritedMethods::C
+ end
end