Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 49 lines (39 sloc) 1.233 kb
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
Something went wrong with that request. Please try again.