mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
[test] add spec for RM-502
This commit is contained in:
@@ -334,3 +334,11 @@ describe "Proc#owner" do
|
||||
b.owner.should == self
|
||||
end
|
||||
end
|
||||
|
||||
describe "C-Blocks" do
|
||||
# RM-502
|
||||
it "should not crash when ObjC method return nil instead of C-Blocks" do
|
||||
obj = TestBlocks.new
|
||||
obj.map.should == nil
|
||||
end
|
||||
end
|
||||
|
||||
12
test/test/vendor/code/blocks.h
vendored
Normal file
12
test/test/vendor/code/blocks.h
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#import "Availability.h"
|
||||
|
||||
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
@interface TestBlocks : NSObject
|
||||
typedef void (^SampleBlock)(NSString* string);
|
||||
- (SampleBlock)map;
|
||||
@end
|
||||
9
test/test/vendor/code/blocks.m
vendored
Normal file
9
test/test/vendor/code/blocks.m
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "blocks.h"
|
||||
|
||||
@implementation TestBlocks
|
||||
- (SampleBlock)map
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user