mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 09:31:20 +08:00
[test] add spec for RM-583
This commit is contained in:
@@ -18,3 +18,24 @@ describe "Module" do
|
||||
end
|
||||
end
|
||||
=end
|
||||
|
||||
describe "Module" do
|
||||
module BaseModule
|
||||
def testMethod1(obj)
|
||||
super
|
||||
end
|
||||
def testMethod2(obj)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class TestRM583 < TestModuleInclude
|
||||
include BaseModule
|
||||
end
|
||||
|
||||
# RM-583
|
||||
it "included module method should be call correctly from Objc" do
|
||||
TestRM583.new.run_testMethod2.should == 456
|
||||
TestRM583.new.run_testMethod1.should == 123
|
||||
end
|
||||
end
|
||||
|
||||
8
test/test/vendor/code/code.h
vendored
8
test/test/vendor/code/code.h
vendored
@@ -130,3 +130,11 @@ typedef struct MyUnionHasBool {
|
||||
+ (id)methodWithObjectVoidPointer:(void *)object;
|
||||
+ (int)methodWithCTypeVoidPointer:(void *)val;
|
||||
@end
|
||||
|
||||
@interface TestModuleInclude : NSObject
|
||||
- (int)testMethod1:(bool)value;
|
||||
- (int)testMethod2:(bool)value;
|
||||
- (int)run_testMethod1;
|
||||
- (int)run_testMethod2;
|
||||
@end
|
||||
|
||||
|
||||
21
test/test/vendor/code/code.m
vendored
21
test/test/vendor/code/code.m
vendored
@@ -227,3 +227,24 @@ ReturnsIntBlock KreateGlobalBlock()
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation TestModuleInclude
|
||||
- (int)testMethod1:(bool)value
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
- (int)testMethod2:(bool)value
|
||||
{
|
||||
return 456;
|
||||
}
|
||||
- (int)run_testMethod1
|
||||
{
|
||||
return [self testMethod1:true];
|
||||
}
|
||||
- (int)run_testMethod2
|
||||
{
|
||||
return [self testMethod2:true];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user