Cedar

274 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
274
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cedar

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

×