SlideShare a Scribd company logo
1 of 17
Download to read offline
ManiokSpecificationByExamplewith
RSpec1 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Aboutme
@21croissants
2 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Agenda
· Specification By Example
· 7 years of Cucumber: lessons learned
· Veggie alternatives
· Introducing: Maniok
· Q & A ?
3 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
SpecificationByExample/
Gherkin?
Scenario: Spec By Example workshop
Given three amigos: Developer / Product / QA
When they talk in front of a white board
And write the outcome of their discussions in "scenarios"
Then they should build the "right" thing
pic from User Story Mapping book
More at http://kickstartacademy.io/
courses/bdd-kickstart
4 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants,
2015-07-08
Cucumber?8Mdownloads
1: Write test in plain text using Gherkin DSL
# features/buy_ticket/earl_bird.feature
Scenario: Early Bird tickets have sold out
Given there are no "Early Bird" tickets le! for "Baruco 2015"
When I want to buy a ticket
Then I should see the "Early Bird" tickets as "SOLD OUT"
5 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
2. Write step definition block in ruby to match
plain text
# features/step_definitions/buy_ticket/early_bird_steps.rb
Given(/^there are no "(.*?)" tickets le! for "(.*?)"$/) do |ticket_type_name, conference_name|
ticket_type = ticket_type_name.gsub(/s/, '_').downcase.to_sym
tickets = { ticket_type => 0 }
create :conference, name: conference_name, with: tickets
end
6 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Cost
· organizing step definitions is hard
· re-use existing step defs does not scale
· Regexp in step defs false idea
· Not fun :(
7 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Slow
Given a feature with a slow background to set lots of immutable test data
When there are 15 scenarios
Then cucumber will run the background for each scenario :(
8 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Capybara"acceptance"DSL
feature "Buy Early Bird ticket" do # describe
background do # before(:each)
end
given(:other_user) { create :user } # let <- Very confusing
scenario "Early Bird tickets have sold out" do # it
visit '/'
click_on "TICKETS"
expect(page).to have_content 'SOLD OUT'
end
Syntactic sugar for devs. Not suitable for Spec By Example
9 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Veggiealternatives
10 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
turnip
# spec/acceptance/buy_ticket/earl_bird.feature
Scenario: Early Bird tickets have sold out
Given there are no "Early Bird" tickets le! for "Baruco 2015"
# spec/steps/buy_ticket/early_bird_steps.rb
module EarlyBirdSteps
step "there are no :ticket_type ticket for :conference_name" do |ticket_type, conference_name|
# same as Cucumber
end
end
By Jonas Nicklas (capybara), 264K downloads
11 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Spinach
# features/buy_ticket/earl_bird.feature
Scenario: Early Bird tickets have sold out
Given there are no "Early Bird" tickets le! for "Baruco 2015"
# features/steps/buy_ticket/early_bird_steps.rb
class Spinach::Features::TestHowSpinachWorks < Spinach::FeatureSteps
Given "there are no "ticket_type" ticket for "conference_name"" do
# Spinach assigns @ticket_type and @conference_name
# rest, same as Cucumber
end
end
By Codegram (Baruco). No I18n! 142K downloads
12 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Maniok (with a k):
RSpec.feature "Early Bird" do
before(:all) { step "Very slow data setup" { } }
scenario "Early Bird tickets have sold out" do
given 'there are no "Early Bird" tickets le! for "Baruco 2015"' do
create :conference, name: "Baruco 2015", with: { early_bird: 0 }
end
when "I want to buy a ticket" do
visit "/"; click_on "TICKETS"
end
then "I should see a big "SOLD OUT" sign and told to subscribe to the newsletter" do
expect(page).to have_content "SOLD OUT"
end
end; end
13 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
GeneratedOutputusingRSpecGherkinFormatter
# features/buy_ticket/earl_bird.feature
Feature: Early Bird
Background:
* Very slow data setup
Scenario: Early Bird tickets have sold out
Given there are no "Early Bird" tickets le! for "Baruco 2015"
When I want to buy a ticket
Then I should see a big "SOLD OUT" sign and told to subscribe to the newsletter
14 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Pros
· small footprint (cuke is 16K LOC of ruby)
· DSL: given, when, then inside scenario block
· No mapping btw plain text feature & step defs
· Declarative style. Re-use ruby test helpers not
plain text
15 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Comingsoon
· Rewrite to make it RSpec 3.0 support
· Gherkin tables & Scenario outlines support
· Tim Pope's Fivemat support w/ Profiling each
step
· HTML formatter a la cucumber
· static HTML formatter a la rdoc (searchable)
16 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
Merci!Q & A
17 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08

More Related Content

More from Jean-Michel Garnier

Tests d'Acceptance utilisateur avec cucumber
Tests d'Acceptance utilisateur avec cucumberTests d'Acceptance utilisateur avec cucumber
Tests d'Acceptance utilisateur avec cucumberJean-Michel Garnier
 
Fast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-gridFast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-gridJean-Michel Garnier
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)Jean-Michel Garnier
 
Intro a RSpec, BDD, webapps User Acceptance Testing
Intro a RSpec, BDD, webapps User Acceptance TestingIntro a RSpec, BDD, webapps User Acceptance Testing
Intro a RSpec, BDD, webapps User Acceptance TestingJean-Michel Garnier
 
Les Tests avec Ruby on Rails et RSpec (in French)
Les Tests avec Ruby on Rails et RSpec (in French)Les Tests avec Ruby on Rails et RSpec (in French)
Les Tests avec Ruby on Rails et RSpec (in French)Jean-Michel Garnier
 

More from Jean-Michel Garnier (9)

Cucumber Ecosystem Presentation
Cucumber Ecosystem PresentationCucumber Ecosystem Presentation
Cucumber Ecosystem Presentation
 
Tests d'Acceptance utilisateur avec cucumber
Tests d'Acceptance utilisateur avec cucumberTests d'Acceptance utilisateur avec cucumber
Tests d'Acceptance utilisateur avec cucumber
 
Tests Interfaces Web avec Rails
Tests Interfaces Web avec RailsTests Interfaces Web avec Rails
Tests Interfaces Web avec Rails
 
Fast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-gridFast web acceptance testing with selenium-grid
Fast web acceptance testing with selenium-grid
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
 
Intro a RSpec, BDD, webapps User Acceptance Testing
Intro a RSpec, BDD, webapps User Acceptance TestingIntro a RSpec, BDD, webapps User Acceptance Testing
Intro a RSpec, BDD, webapps User Acceptance Testing
 
Les Tests avec Ruby on Rails et RSpec (in French)
Les Tests avec Ruby on Rails et RSpec (in French)Les Tests avec Ruby on Rails et RSpec (in French)
Les Tests avec Ruby on Rails et RSpec (in French)
 
Global Warming Lifestyle Change
Global Warming Lifestyle ChangeGlobal Warming Lifestyle Change
Global Warming Lifestyle Change
 
Testing Ruby on Rails (spanish)
Testing Ruby on Rails (spanish)Testing Ruby on Rails (spanish)
Testing Ruby on Rails (spanish)
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

2015 07 08_genevarb_maniok_presentation

  • 1. ManiokSpecificationByExamplewith RSpec1 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 2. Aboutme @21croissants 2 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 3. Agenda · Specification By Example · 7 years of Cucumber: lessons learned · Veggie alternatives · Introducing: Maniok · Q & A ? 3 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 4. SpecificationByExample/ Gherkin? Scenario: Spec By Example workshop Given three amigos: Developer / Product / QA When they talk in front of a white board And write the outcome of their discussions in "scenarios" Then they should build the "right" thing pic from User Story Mapping book More at http://kickstartacademy.io/ courses/bdd-kickstart 4 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 5. Cucumber?8Mdownloads 1: Write test in plain text using Gherkin DSL # features/buy_ticket/earl_bird.feature Scenario: Early Bird tickets have sold out Given there are no "Early Bird" tickets le! for "Baruco 2015" When I want to buy a ticket Then I should see the "Early Bird" tickets as "SOLD OUT" 5 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 6. 2. Write step definition block in ruby to match plain text # features/step_definitions/buy_ticket/early_bird_steps.rb Given(/^there are no "(.*?)" tickets le! for "(.*?)"$/) do |ticket_type_name, conference_name| ticket_type = ticket_type_name.gsub(/s/, '_').downcase.to_sym tickets = { ticket_type => 0 } create :conference, name: conference_name, with: tickets end 6 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 7. Cost · organizing step definitions is hard · re-use existing step defs does not scale · Regexp in step defs false idea · Not fun :( 7 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 8. Slow Given a feature with a slow background to set lots of immutable test data When there are 15 scenarios Then cucumber will run the background for each scenario :( 8 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 9. Capybara"acceptance"DSL feature "Buy Early Bird ticket" do # describe background do # before(:each) end given(:other_user) { create :user } # let <- Very confusing scenario "Early Bird tickets have sold out" do # it visit '/' click_on "TICKETS" expect(page).to have_content 'SOLD OUT' end Syntactic sugar for devs. Not suitable for Spec By Example 9 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 10. Veggiealternatives 10 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 11. turnip # spec/acceptance/buy_ticket/earl_bird.feature Scenario: Early Bird tickets have sold out Given there are no "Early Bird" tickets le! for "Baruco 2015" # spec/steps/buy_ticket/early_bird_steps.rb module EarlyBirdSteps step "there are no :ticket_type ticket for :conference_name" do |ticket_type, conference_name| # same as Cucumber end end By Jonas Nicklas (capybara), 264K downloads 11 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 12. Spinach # features/buy_ticket/earl_bird.feature Scenario: Early Bird tickets have sold out Given there are no "Early Bird" tickets le! for "Baruco 2015" # features/steps/buy_ticket/early_bird_steps.rb class Spinach::Features::TestHowSpinachWorks < Spinach::FeatureSteps Given "there are no "ticket_type" ticket for "conference_name"" do # Spinach assigns @ticket_type and @conference_name # rest, same as Cucumber end end By Codegram (Baruco). No I18n! 142K downloads 12 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 13. Maniok (with a k): RSpec.feature "Early Bird" do before(:all) { step "Very slow data setup" { } } scenario "Early Bird tickets have sold out" do given 'there are no "Early Bird" tickets le! for "Baruco 2015"' do create :conference, name: "Baruco 2015", with: { early_bird: 0 } end when "I want to buy a ticket" do visit "/"; click_on "TICKETS" end then "I should see a big "SOLD OUT" sign and told to subscribe to the newsletter" do expect(page).to have_content "SOLD OUT" end end; end 13 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 14. GeneratedOutputusingRSpecGherkinFormatter # features/buy_ticket/earl_bird.feature Feature: Early Bird Background: * Very slow data setup Scenario: Early Bird tickets have sold out Given there are no "Early Bird" tickets le! for "Baruco 2015" When I want to buy a ticket Then I should see a big "SOLD OUT" sign and told to subscribe to the newsletter 14 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 15. Pros · small footprint (cuke is 16K LOC of ruby) · DSL: given, when, then inside scenario block · No mapping btw plain text feature & step defs · Declarative style. Re-use ruby test helpers not plain text 15 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 16. Comingsoon · Rewrite to make it RSpec 3.0 support · Gherkin tables & Scenario outlines support · Tim Pope's Fivemat support w/ Profiling each step · HTML formatter a la cucumber · static HTML formatter a la rdoc (searchable) 16 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08
  • 17. Merci!Q & A 17 — Maniok Lightning Talk at Geneva.rb. By Jean-Michel Garnier @21croissants, 2015-07-08