Created
February 25, 2014 10:44
-
-
Save yuuki1224/9206693 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Kiwi.h" | |
#import "FacebookManager.h" | |
SPEC_BEGIN(FacebookManagerSpec) | |
describe(@"FacebookManager", ^{ | |
__block FacebookManager *manager = [FacebookManager sharedManager]; | |
context(@"sessionが開いてるとき", ^{ | |
beforeAll(^{ | |
[manager login]; | |
}); | |
it(@"ログインしているか", ^{ | |
[[theValue([manager isLogin]) should] equal:theValue(YES)]; | |
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | |
[[[defaults objectForKey:KEY_DEFAULT_FACEBOOK_USERNAME] shouldNot] equal:NULL]; | |
[[theValue([manager isEmptyCache]) should] equal:theValue(NO)]; | |
}); | |
it(@"ログアウトできること", ^{ | |
[[theValue([manager logout]) should] equal:theValue(YES)]; | |
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | |
[[[defaults objectForKey:KEY_DEFAULT_FACEBOOK_USERNAME] should] equal:NULL]; | |
[[theValue([manager isEmptyCache]) should] equal:theValue(YES)]; | |
}); | |
}); | |
context(@"sessionが開いてないとき", ^{ | |
it(@"ログインできること", ^{ | |
[manager login]; | |
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
[[[defaults objectForKey:KEY_DEFAULT_FACEBOOK_USERNAME] shouldNot] equal:NULL]; | |
}); | |
it(@"ログインしていないこと", ^{ | |
[[theValue([manager isLogin]) should] equal:theValue(NO)]; | |
}); | |
it(@"ログアウトできないこと", ^{ | |
}); | |
}); | |
}); | |
SPEC_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment