0
CedarTesting in iOSJeff Hui
WhyTest?
WhyTest?•Catch regressions
WhyTest?•Catch regressions•Better design
WhyTest?•Catch regressions•Better design•Refactor more confidently
Why Cedar?
Why Cedar?•Cross-platform
Why Cedar?•Cross-platform•Fast
Why Cedar?•Cross-platform•Fast•Elegant DSL
describe(@”bowler”, ^{beforeEach(^{// do stuff});describe(@”-score”, ^{context(@”when having a perfect game”, ^{it(@”shoul...
value should equal(@”someString”);
value should equal(5);
id runLoop = nice_fake_for([NSRunLoop class]);// do stuffNSTimer *expectedTimer = ....;runLoop shouldhave_received(@select...
spy_on(controller.textField);[controller.textField becomeFirstResponder];controller.textField shouldhave_received(@selecto...
sharedExamplesFor(@”showing an alert”, ^(NSDictionary*context){it(@”shows an alert”, ^{...});});describe(@”tapping the sub...
• Cedar (github.com/pivotal/cedar)• PivotalCoreKit (github.com/pivotal/pivotalcorekit)• CedarShortcuts (github.com/cppforl...
Upcoming SlideShare
Loading in...5
×

Cedar

102

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
102
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "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)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×