Your SlideShare is downloading. ×
0
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Cuke2Beer
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cuke2Beer

1,377

Published on

5 minute presentation on cucumber presented at DemoCampGuelph11

5 minute presentation on cucumber presented at DemoCampGuelph11

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,377
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
32
Comments
0
Likes
2
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.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. How do we know we are done?<br />Build<br />Specification<br />Tests Cases<br />Test<br />Deploy<br /><ul><li>Long feedback loops
  • 8. Keeping specs, system and test cases in sync
  • 9. Silos of specification, build, test</li></li></ul><li><ul><li>Reduces feedback loops
  • 10. Combines specifications, test cases &code
  • 11. Promotes collaboration</li></li></ul><li>Specification<br />Executable!<br />
  • 12. Executable Specification<br />
  • 13. Cucumber Organization<br />Load<br />Match<br />Features<br />Step Definitions<br />Call<br />System Under Test<br />
  • 14. Feature File<br />Feature: Turn cucumber into beer<br /> As a cucumber presenter<br /> I want beer after my presentation<br /> So I can enjoy the rest of DemoCampGuelph<br /> Scenario: Brydon buys Declan beer<br />Given Brydon hosts DemoCampGuelph<br />When Declan demos Cucumber<br />Then Brydon should buy Declan 1 beer<br />Scenario: Ali buys Declan beer<br />Given Ali hosts DemoCampGuelph<br />When Declan demos Cucumber<br />Then Ali should buy Declan 1 beer<br />
  • 15. Step Definitions<br />Given /^(.+) hosts/ do |host|<br /> @event = Event.new(host)<br />end<br />When/^(.+) demos/ do |presenter|<br /> @event.add(presenter)<br />end<br />Then/^(.+) should buy (.+) (d+) (.*)$/ do |buyer, drinker, qty, item|<br /> perk = @event.perks[0]; <br />perk.buyer.should == buyer; perk.receiver.should == drinker<br />perk.quantity.should == quantity.to_i; perk.item.should == item <br />end<br />
  • 16. System Under Test<br />class Event<br />attr_reader :perks<br /> def initialize(host) @host = host; @perks = [] end<br /> def add(presenter)<br /> @perks.pushPerk.new(@host, presenter, 1, &quot;beer&quot;)<br /> end <br />end<br />class Perk<br />attr_reader :buyer, :receiver, :quantity, :item<br /> def initialize(buyer, receiver, quantity, item)<br /> @buyer = buyer; @receiver = receiver<br /> @quantity = quantity; @item = item<br /> end<br />end<br />
  • 17. Execution<br /> Scenario: Brydon buys Declan beer<br />Given Brydon hosts DemoCampGuelph<br />When Declan demos Cucumber<br />Then Brydon should buy Declan 1 beer<br />Given /^(.+) hosts/ do |host|<br /> @event = Event.new(host)<br />End<br />When/^(.+) demos/ do |presenter|<br /> @event.add(presenter)<br />end<br />“Brydon”<br />Then/^(.+) should buy (.+) (d+) (.*)$/ do |buyer, drinker, qty, item|<br /> perk = @event.perks[0]; <br />perk.buyer.should == buyer; perk.receiver.should == drinker<br />perk.quantity.should == quantity.to_i; perk.item.should == item <br />end<br />
  • 18. Execution<br /> Scenario: Brydon buys Declan beer<br />Given Brydon hosts DemoCampGuelph<br />When Declan demos Cucumber<br />Then Brydon should buy Declan 1 beer<br />Given /^(.+) hosts/ do |host|<br /> @event = Event.new(host)<br />End<br />When/^(.+) demos/ do |presenter|<br /> @event.add(presenter)<br />end<br />“Declan”<br />Then/^(.+) should buy (.+) (d+) (.*)$/ do |buyer, drinker, qty, item|<br /> perk = @event.perks[0]; <br />perk.buyer.should == buyer; perk.receiver.should == drinker<br />perk.quantity.should == quantity.to_i; perk.item.should == item <br />end<br />
  • 19. Execution<br /> Scenario: Brydon buys Declan beer<br />Given Brydon hosts DemoCampGuelph<br />When Declan demos Cucumber<br />Then Brydon should buy Declan 1 beer<br />Given /^(.+) hosts/ do |host|<br /> @event = Event.new(host)<br />End<br />When/^(.+) demos/ do |presenter|<br /> @event.add(presenter)<br />end<br />Then/^(.+) should buy (.+) (d+) (.*)$/ do |buyer, drinker, qty, item|<br /> perk = @event.perks[0]; <br />perk.buyer.should == buyer; perk.receiver.should == drinker<br />perk.quantity.should == quantity.to_i; perk.item.should == item <br />end<br />
  • 20. Spoken Languages<br />English Arabic Bulgarian Catalan Welsh Czech<br />Danish German Australian LOLCAT Texan<br />Spanish Estonian Finnish French Hebrew<br />Croatian Hungarian Indonesian Italian<br />Japanese Korean Lithuanian Latvian<br />Dutch Norwegian Polish Portuguese<br />Romanian Romanian-diacritical<br />Russian Swedish Uzbek Vietnamese<br />Chinese-simplified Chinese-traditional<br />
  • 21. Cucumber Support<br />
  • 22. More Stuff<br />http://cukes.info/<br />http://wiki.github.com/aslakhellesoy/cucumber<br />Declan Whelan<br />http://dpwhelan.com<br />http://twitter.com/dwhelan<br />

×