{"action":"closed","issue":{"url":"https://api.github.com/repos/specta/specta/issues/44","labels_url":"https://api.github.com/repos/specta/specta/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/specta/specta/issues/44/comments","events_url":"https://api.github.com/repos/specta/specta/issues/44/events","html_url":"https://github.com/specta/specta/issues/44","id":18606234,"number":44,"title":"AsyncBlock, NSOperationQueue and expect","user":{"login":"yageek","id":170917,"avatar_url":"https://avatars.githubusercontent.com/u/170917?v=3","gravatar_id":"","url":"https://api.github.com/users/yageek","html_url":"https://github.com/yageek","followers_url":"https://api.github.com/users/yageek/followers","following_url":"https://api.github.com/users/yageek/following{/other_user}","gists_url":"https://api.github.com/users/yageek/gists{/gist_id}","starred_url":"https://api.github.com/users/yageek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yageek/subscriptions","organizations_url":"https://api.github.com/users/yageek/orgs","repos_url":"https://api.github.com/users/yageek/repos","events_url":"https://api.github.com/users/yageek/events{/privacy}","received_events_url":"https://api.github.com/users/yageek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2013-08-27T13:15:01Z","updated_at":"2015-10-06T07:04:50Z","closed_at":"2015-10-06T07:04:50Z","body":"I have a problem using Specta with an NSOperation and a block. If you look at the test code below, I use a custom NSOperation which is given a completion block. In this block I called an *expect* statement that is always false before calling done();\r\n\r\nThe problem is that Xcode tells me that the test succeeded.\r\n\r\n```objc\r\n#import <Specta/Specta.h>\r\n#define EXP_SHORTHAND\r\n#import <Expecta/Expecta.h>\r\n#import \"YGParseGPXOperation.h\"\r\n\r\nSpecBegin(GPXImport)\r\n\r\ndescribe(@\"GPX Import\",^{\r\n\r\n    __block NSOperationQueue * testQueue =nil;\r\n\r\n    beforeAll(^{\r\n\r\n        testQueue = [[NSOperationQueue alloc] init];\r\n        [Expecta setAsynchronousTestTimeout:10.0];\r\n\r\n    });\r\n\r\n    it(@\"should import GPX into context\",^AsyncBlock{\r\n\r\n        NSManagedObjectContext * context = [[NSManagedObjectContext alloc] init];\r\n\r\n        NSString *bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:@\"gpxTest\" ofType:@\"bundle\"];\r\n        NSBundle * bundle = [NSBundle bundleWithPath:bundlePath];\r\n        NSURL * gpxURL = [bundle URLForResource:@\"STRASBOURG\" withExtension:@\"gpx\"];\r\n\r\n        YGParseGPXOperation * op = [[YGParseGPXOperation alloc] initWithGPXURL:gpxURL inContext:context];\r\n\r\n        op.completionBlock = ^(NSError* error){\r\n            expect(1).to.equal(2);\r\n            done();\r\n        };\r\n\r\n        [testQueue addOperation:op];\r\n        \r\n    });\r\n    \r\n    \r\n    \r\n});\r\n\r\nSpecEnd\r\n```"}}