Slide 11
Slide 11 text
Kiwi test file - contexts & tests
context(@"matching nothing", ^{
it(@"returns an empty dictionary", ^{
NSDictionary *result = [subject subdictionaryUsingKeys:@"foo", nil];
[[theValue(result.count) should] equal:theValue(0)];
});
});
context(@"matching something", ^{
it(@"returns a subset dictionary", ^{
NSDictionary *result = [subject subdictionaryUsingKeys:@"a", nil];
[[result should] equal:[NSDictionary dictionaryWithObject:@"1" forKey:@"a"]];
});
});
context(@"matching ALL THE THINGS", ^{
it(@"returns a copy of the dictionary", ^{
NSDictionary *result = [subject subdictionaryUsingKeys:@"a", @"b", @"c", nil];
[[result should] equal:[subject copy]];
});
});