cedarbdd / cedar

BDD-style testing using Objective-C
http://groups.google.com/group/cedar-discuss
1.19k stars 140 forks source link

Cedar silently accepts misuse of the test structure DSL #393

Closed briancroom closed 8 years ago

briancroom commented 8 years ago

The following code runs, with the incorrectly-placed nested contexts being silently ignored:

it(@"has an outer test", ^{            
    context(@"when a context is nested inside of an 'it'", ^{
        it(@"blah", ^{
            1 should equal(2); // This test is not executed
        });
    });
});

Cedar should probably just throw an exception if context, describe, it etc. are called while a test is being executed.