/
ShouldSyntaxSpec.mm
48 lines (39 loc) · 1.2 KB
/
ShouldSyntaxSpec.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#if TARGET_OS_IPHONE
// Normally you would include this file out of the framework. However, we're
// testing the framework here, so including the file from the framework will
// conflict with the compiler attempting to include the file from the project.
#import "SpecHelper.h"
#else
#import <Cedar/SpecHelper.h>
#endif
extern "C" {
#import "ExpectFailureWithMessage.h"
}
using namespace Cedar::Matchers;
SPEC_BEGIN(ShouldSyntaxSpec)
describe(@"Should syntax", ^{
describe(@"should", ^{
it(@"should work with positive case", ^{
3 should equal(3);
});
it(@"should work correctly with operator precendence", ^{
1 + 2 should equal(3);
});
it(@"should work with negative case", ^{
expectFailureWithMessage(@"Expected <3> to equal <4>", ^{
3 should equal(4);
});
});
});
describe(@"should_not", ^{
it(@"should work with positive case", ^{
3 should_not equal(4);
});
it(@"should work with negative case", ^{
expectFailureWithMessage(@"Expected <3> to not equal <3>", ^{
3 should_not equal(3);
});
});
});
});
SPEC_END