Skip to content

Instantly share code, notes, and snippets.

@topfunky
Forked from jm/gist:52501
Created January 25, 2009 20:19
Show Gist options
  • Save topfunky/52512 to your computer and use it in GitHub Desktop.
Save topfunky/52512 to your computer and use it in GitHub Desktop.
// And what about block-based contexts:
NSString * myString = @"Bacon";
[self test:@"has a class of NSString" code:^{
// Old style
STAssertTrue([myString isKindOfClass:[NSString class]], @"Got %@ class", [myString class]);
// BDD style?
[[myString className] shouldEqual:@"NSCFString"];
}];
// I like this better than [[obj should] equal:32]...
// fewer brackets (but maybe that's too limiting if you want a custom matcher).
[[centigradeFreezingPoint intValue] shouldEqual:32];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment