Your SlideShare is downloading. ×
  • Like
Cedar
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply
Published

 

Published in Business , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
80
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CedarTesting in iOSJeff Hui
  • 2. WhyTest?
  • 3. WhyTest?•Catch regressions
  • 4. WhyTest?•Catch regressions•Better design
  • 5. WhyTest?•Catch regressions•Better design•Refactor more confidently
  • 6. Why Cedar?
  • 7. Why Cedar?•Cross-platform
  • 8. Why Cedar?•Cross-platform•Fast
  • 9. Why Cedar?•Cross-platform•Fast•Elegant DSL
  • 10. describe(@”bowler”, ^{beforeEach(^{// do stuff});describe(@”-score”, ^{context(@”when having a perfect game”, ^{it(@”should return a perfect score”, ^{});});});});
  • 11. value should equal(@”someString”);
  • 12. value should equal(5);
  • 13. id runLoop = nice_fake_for([NSRunLoop class]);// do stuffNSTimer *expectedTimer = ....;runLoop shouldhave_received(@selector(addTimer:forMode:)).with(expectedTimer, NSDefaultRunLoopMode);Fakes/Doubles
  • 14. spy_on(controller.textField);[controller.textField becomeFirstResponder];controller.textField shouldhave_received(@selector(becomeFirstResponder));Spies
  • 15. sharedExamplesFor(@”showing an alert”, ^(NSDictionary*context){it(@”shows an alert”, ^{...});});describe(@”tapping the submit button”, ^{itShouldBehaveLike(@”showing an alert”);});describe(@”tapping another”, ^{itShouldBehaveLike(@”showing an alert”);});Shared Examples
  • 16. • Cedar (github.com/pivotal/cedar)• PivotalCoreKit (github.com/pivotal/pivotalcorekit)• CedarShortcuts (github.com/cppforlife/CedarShortcuts)• BetterConsole (github.com/cppforlife/BetterConsole)