Skip to content

@alloy /gist:4564152
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Expectations: Count changes

  • [[theBlock(^{ ... }) should] change:^{ return (NSInteger)count; }]
  • [[theBlock(^{ ... }) should] change:^{ return (NSInteger)count; } by:+1]
  • [[theBlock(^{ ... }) should] change:^{ return (NSInteger)count; } by:-1]

Example:

    [[theBlock(^{
        [array addObject:@"foo"];
    }) should] change:^{ return (NSInteger)[array count]; } by:+1];

    [[theBlock(^{
        [array addObject:@"bar"];
        [array removeObject:@"foo"];
    }) shouldNot] change:^{ return (NSInteger)[array count]; }];

    [[theBlock(^{
        [array removeObject:@"bar"];
    }) should] change:^{ return (NSInteger)[array count]; } by:-1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.