Skip to content

Instantly share code, notes, and snippets.

@andrespch
Last active March 13, 2020 16:32
Show Gist options
  • Save andrespch/19e52150214c4b435e7f2a7ea68cf5d1 to your computer and use it in GitHub Desktop.
Save andrespch/19e52150214c4b435e7f2a7ea68cf5d1 to your computer and use it in GitHub Desktop.
#import <Specta/Specta.h>
#import "User.h"
SpecBegin(User)
__block User *subject;
before(^{
subject = [[User alloc] init];
});
after(^{
subject = nil;
});
describe(@"-canSubscribeToNewsletter", ^{
context(@"email confirmed", ^{
before(^{
subject.hasConfirmedEmail = NO;
});
it(@"is true", ^{
NSAssertTrue([subject canSubscribeToNewsletter]);
});
});
context(@"email not confirmed", ^{
before(^{
subject.hasConfirmedEmail = YES;
});
it(@"is false", ^{
NSAssertFalse([subject canSubscribeToNewsletter]);
});
});
});
SpecEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment