add spec for #super

Related to http://hipbyte.myjetbrains.com/youtrack/issue/RM-322
This commit is contained in:
Watson
2013-11-15 22:44:23 +09:00
parent cee7f2d260
commit 9f0fc307ed

View File

@@ -15,6 +15,20 @@ class Foo < Base
end
end
class B < UIView
def frame=(value)
NSLog "Calling B with #{value}"
super
end
end
class C < B
def frame=(value)
NSLog "Calling C with #{value}"
super(value)
end
end
$spec_result = []
describe "'super'" do
@@ -23,4 +37,12 @@ describe "'super'" do
obj.bar(%w{1 2 3})
$spec_result.should == ["a", "1", "a", "2", "a", "3", "a", nil]
end
it "should lookup shortcut method" do
# RM-322
c = C.alloc.init
c.frame = [[42,0],[0,0]]
c.frame.origin.x.should == 42
end
end