mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-23 12:27:56 +08:00
[test] add spec for RM-541
This commit is contained in:
21
test/test/spec/method_spec.rb
Normal file
21
test/test/spec/method_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
describe "Method" do
|
||||
class TestMethodA
|
||||
def foo
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class TestMethodB < TestMethodA
|
||||
def foo
|
||||
end
|
||||
end
|
||||
|
||||
class TestMethodC < TestMethodA
|
||||
end
|
||||
|
||||
# RM-541
|
||||
it "#owner should return correct owner if override the method in inherited class" do
|
||||
TestMethodB.new.method(:foo).owner.should == TestMethodB
|
||||
TestMethodC.new.method(:foo).owner.should == TestMethodA
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user