Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should not be possible to create an async verifier for a regular subject #621

Open
sharplet opened this issue Aug 3, 2015 · 0 comments
Labels

Comments

@sharplet
Copy link
Contributor

sharplet commented Aug 3, 2015

This spec fails, and it's kind of confusing:

it(@"should not allow regular subjects to be attached to async verifiers", ^{
    __block BOOL called = NO;

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        [NSThread sleepForTimeInterval:0.1];
        called = YES;
    });

    [[theValue(called) shouldEventually] beYes];
});

The problem is very non-obvious: we should be using expectFutureValue() so that we can poll until the value changes.

This should fail with a more descriptive error, pointing users to expectFutureValue(). Ideally, it would be great if there was a compiler warning or error to prevent this test from ever running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant