mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-23 04:20:24 +08:00
add spec for #super
Related to http://hipbyte.myjetbrains.com/youtrack/issue/RM-322
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user