[test] add spec for RM-502

This commit is contained in:
Watson
2014-06-05 14:04:13 +09:00
parent a5da71c3b7
commit e93ce057aa
3 changed files with 29 additions and 0 deletions

View File

@@ -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
View 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
View File

@@ -0,0 +1,9 @@
#include "blocks.h"
@implementation TestBlocks
- (SampleBlock)map
{
return nil;
}
@end