Skip to content

Commit

Permalink
Added test for incomplete datasource in MMFlowView
Browse files Browse the repository at this point in the history
  • Loading branch information
mmllr committed Apr 1, 2014
1 parent 793f0c6 commit 276ca22
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Classes/osx/Specs/MMFlowViewSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,24 @@ software and associated documentation files (the "Software"), to deal in the Sof
[[datasourceMock should] receive:@selector(numberOfItemsInFlowView:)];
[sut reloadContent];
});
context(@"when having a incomplete datasource", ^{
beforeEach(^{
datasourceMock = [KWMock nullMock];
sut.dataSource = datasourceMock;
});
context(NSStringFromSelector(@selector(reloadContent)), ^{
it(@"should set the number of items to zero", ^{
[sut reloadContent];

[[theValue(sut.numberOfItems) should] beZero];
});
it(@"should not ask the datasource for the number of items", ^{
[[datasourceMock shouldNot] receive:@selector(numberOfItemsInFlowView:)];

[sut reloadContent];
});
});
});
});
context(@"one item", ^{
NSString *expectedTitle = @"0";
Expand Down

0 comments on commit 276ca22

Please sign in to comment.