describe(@"VVStack"?? ^{
context(@"when created"?? ^{
__block VVStack *stack = nil;
beforeEach(^{
stack = [VVStack new];
});
afterEach(^{
stack = nil;
});
it(@"should have the class VVStack"?? ^{
[[[VVStack class] shouldNot] beNil];
});
it(@"should exist"?? ^{
[[stack shouldNot] beNil];
});
it(@"should be able to push and get top"?? ^{
[stack push:2.3];
[[theValue([stack top]) should] equal:theValue(2.3)];
[stack push:4.6];
[[theValue([stack top]) should] equal:4.6 withDelta:0.001];
});
});
});

???????????????????β?????ò????????????????????????stack???????beforeEach??afterEach??block?е?????????????????????????????????__block???????Σ???????????should????shouldNot??????????????????????????????????????????????Kiwi???????????????????????????????theValue????????????????????????????????????????2.3???????????д???????ж???????????????漰???????????????????????????????????????о????????????????????????4.6?????е?equal:withDelta:?????????????????demo??????????ú?????2.3???????????????

????????????????????context???????????????????????????????????????????????????Array??????洢?????????????????ù???equal?????????????????????????????????
????it(@"should equal contains 0 element"?? ^{
????[[theValue([stack.numbers count]) should] equal:theValue(0)];
????});
??????β?????????????????????????з??????????????????????????????????д??Extension???numbers??????????У???????????????????????????????????????????????????-count????????????numbers????????????????numbers???????????????????????????theValue???????????????????????????????????????????????£????????0?????????????beZero????????????????á?????д??????VVStack.h??????????????????????

 

//VVStack.h
//...
- (NSUInteger)count;
//...
//VVStack.m
//...
- (NSUInteger)count {
return [self.numbers count];
}
//...
it(@"should equal contains 0 element"?? ^{
[[theValue([stack count]) should] beZero];
});