main
 1#import "Kiwi.h"
 2#import "../MovieLibrary/Movie.m"
 3#import "../MovieLibrary/MovieLibrary.m"
 4
 5SPEC_BEGIN(MovieLibrarySpec)
 6
 7describe(@"MovieLibrary", ^{
 8    context(@"when movies are added", ^{
 9      __block id sut = nil;
10      __block id brave = nil;
11      __block id monsters_inc = nil;
12      __block id blah = nil;
13
14      beforeAll(^{
15        sut = [MovieLibrary new];
16        brave = [Movie new];
17        monsters_inc = [Movie new];
18        blah = [Movie new];
19        [sut add:brave];
20        [sut add:monsters_inc];
21      });
22
23      it(@"should indicate the corrent number of movies", ^{
24        int result = [sut total_movies];
25        [[theValue(result) should] equal:theValue(2)];
26      });
27
28      it(@"should include each movie", ^{
29        [[theValue([sut includes:brave]) should] equal:theValue(true)];
30        [[theValue([sut includes:monsters_inc]) should] equal:theValue(true)];
31      });
32
33      context(@"when a movie is not in the library", ^{
34          it(@"should return false", ^{
35            [[theValue([sut includes:blah]) should] equal:theValue(false)];
36          });
37      });
38    });
39});
40
41SPEC_END