topfunky (owner)

Fork Of

Revisions

gist: 52512 Download_button fork
public
Public Clone URL: git://gist.github.com/52512.git
Embed All Files: show embed
Objective-C #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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];