SlideShare uma empresa Scribd logo
1 de 27
Viva la Cucaruba!

Matt Yoho
@mattyoho
CUCARUBA!   MATT YOHO




                    Integration testing
                       for Rails gem
                          plugins
CUCARUBA!   MATT YOHO




    Cucumber
CUCARUBA! MATT YOHO

                      Aruba
CUCARUBA!   MATT YOHO




                          cucumber features
                        for command line apps
CUCARUBA!   MATT YOHO
CUCARUBA! MATT YOHO




              YO DAWG! I heard you like features in
              your features so we put cukes in your
                              cukes!
CUCARUBA!   MATT YOHO




                        For example...
CUCARUBA!   MATT YOHO




class WidgetController < AppController

 before_filter :find_widget, :only =>
  [:show, :edit, :update]

 def find_widget
  @widget ||= Widget.find(params[:id])
 end
end
CUCARUBA!   MATT YOHO




class WidgetController < AppController

  assume :widget

end
CUCARUBA!   MATT YOHO




class WidgetController < AppController

 def user_accout
  current_user.account
 end
 hide_action :user_account
 helper_method :user_account
end
CUCARUBA!   MATT YOHO




class WidgetController < AppController

 assume(:account) do
  current_user.account
 end
end
CUCARUBA!   MATT YOHO




                   Specs go a long way, but...
CUCARUBA!   MATT YOHO




                   Specs go a long way, but...


                        Rails dependencies, etc.
CUCARUBA!   MATT YOHO




                        Yuck.
CUCARUBA! MATT YOHO




      ~/projects/app/tmp/aruba
CUCARUBA! MATT YOHO




      ~/projects/app/tmp/aruba


                             ./tmp/aruba
                      rake
                      task
CUCARUBA! MATT YOHO




      ~/projects/app/tmp/aruba


                  templates          ./tmp/aruba
                              rake
                              task
CUCARUBA!   MATT YOHO



Feature: Rails Controllers Can Make Assumptions

 Scenario: controller invokes assume
  Given a file named "app/controllers/widgets_controller.rb" with:
   """
   class WidgetsController < ApplicationController
     assume(:widget) { Widget.find(params[:id]) }
   end
   """
  And a file named "app/views/widgets/show.html.erb" with:
   """
   <blink><%= widget.name %></blink>
   """
  And a file named "features/widget_is_viewed_by_visitor.feature" with:
   """
   Feature: Widget is viewed by visitor
     Scenario: success
       Given a widget named "foobar"
       When I view the widget
       Then I should see "foobar"
   """
  When I run "cucumber features/widget_is_viewed_by_visitor.feature"
  Then I should see:
   """
   1 scenario (1 passed)
   3 steps
   """
CUCARUBA!   MATT YOHO




Feature: Foo Does Something
 Scenario: foo works
  Given a file named "foo.feature" with:
    """
    Feature: Widget is viewed by visitor
      Scenario: success
        Given a foo named "bar"
        When I view the foo
        Then I should see "bar"
    """
  When I run "cucumber foo.feature"
  Then I should see:
    """
    1 scenario (1 passed)
    1 step
    """
CUCARUBA!   MATT YOHO




            A little slow, but totally badass.
CUCARUBA! MATT YOHO
CUCARUBA!   MATT YOHO




                         RVM and Bundler
                        are complimentary
CUCARUBA!   MATT YOHO




                 Be kind to your contributors
CUCARUBA!   MATT YOHO




                         Get
                        Forked
CUCARUBA! MATT YOHO




  http://github.com/aslakhellesoy/aruba

           http://github.com/rspec/rspec-
                         rails

              http://github.com/mattyoho/
                    basic_assumption
Thank you
Matt Yoho
matt@edgecase.com
@mattyoho

Mais conteúdo relacionado

Destaque

Hy solution사례(5)저축보험가입고객
Hy solution사례(5)저축보험가입고객Hy solution사례(5)저축보험가입고객
Hy solution사례(5)저축보험가입고객valuasset
 
IMC Class: 8/27/13
IMC Class: 8/27/13IMC Class: 8/27/13
IMC Class: 8/27/13gaitlady
 
Benefits, Program Summary
Benefits, Program SummaryBenefits, Program Summary
Benefits, Program Summaryfrolovalevi
 
Hy solution사례(4)친디아변액가입고객
Hy solution사례(4)친디아변액가입고객Hy solution사례(4)친디아변액가입고객
Hy solution사례(4)친디아변액가입고객valuasset
 
分布式和文件系统
分布式和文件系统分布式和文件系统
分布式和文件系统pluschen
 
Hy solution사례(2)즉시연금고객제안사례
Hy solution사례(2)즉시연금고객제안사례Hy solution사례(2)즉시연금고객제안사례
Hy solution사례(2)즉시연금고객제안사례valuasset
 
[HY Solution]글로벌경기 긴급진단
[HY Solution]글로벌경기 긴급진단[HY Solution]글로벌경기 긴급진단
[HY Solution]글로벌경기 긴급진단valuasset
 
高崎経済大学の受験..
高崎経済大学の受験..高崎経済大学の受験..
高崎経済大学の受験..kobayashimasakazu
 
Los mejores futbolistas europeos
Los mejores futbolistas europeosLos mejores futbolistas europeos
Los mejores futbolistas europeosJosé Romero
 

Destaque (20)

Hy solution사례(5)저축보험가입고객
Hy solution사례(5)저축보험가입고객Hy solution사례(5)저축보험가입고객
Hy solution사례(5)저축보험가입고객
 
Personal clouds & mobiles - ambientic - fossa2011
Personal clouds & mobiles - ambientic - fossa2011Personal clouds & mobiles - ambientic - fossa2011
Personal clouds & mobiles - ambientic - fossa2011
 
Buku Upah Layak AJI, 2011 - Survei Upah Layak Jurnalis di 16 Kota di Indonesia
Buku Upah Layak AJI, 2011 - Survei Upah Layak Jurnalis di 16 Kota di IndonesiaBuku Upah Layak AJI, 2011 - Survei Upah Layak Jurnalis di 16 Kota di Indonesia
Buku Upah Layak AJI, 2011 - Survei Upah Layak Jurnalis di 16 Kota di Indonesia
 
Laporan Tahunan AJI 2010 - Ancaman Itu Datang dari Dalam
Laporan Tahunan AJI 2010 - Ancaman Itu Datang dari DalamLaporan Tahunan AJI 2010 - Ancaman Itu Datang dari Dalam
Laporan Tahunan AJI 2010 - Ancaman Itu Datang dari Dalam
 
Buku Panduan : Media dan Reformasi Sektor Keamanan
Buku Panduan : Media dan Reformasi Sektor KeamananBuku Panduan : Media dan Reformasi Sektor Keamanan
Buku Panduan : Media dan Reformasi Sektor Keamanan
 
sns
snssns
sns
 
Annual Report AJI 2009 : Press in the Midst of Crisis and Threat
Annual Report AJI 2009 :  Press in the Midst of Crisis and ThreatAnnual Report AJI 2009 :  Press in the Midst of Crisis and Threat
Annual Report AJI 2009 : Press in the Midst of Crisis and Threat
 
IMC Class: 8/27/13
IMC Class: 8/27/13IMC Class: 8/27/13
IMC Class: 8/27/13
 
Benefits, Program Summary
Benefits, Program SummaryBenefits, Program Summary
Benefits, Program Summary
 
Hy solution사례(4)친디아변액가입고객
Hy solution사례(4)친디아변액가입고객Hy solution사례(4)친디아변액가입고객
Hy solution사례(4)친디아변액가입고객
 
分布式和文件系统
分布式和文件系统分布式和文件系统
分布式和文件系统
 
Hy solution사례(2)즉시연금고객제안사례
Hy solution사례(2)즉시연금고객제안사례Hy solution사례(2)즉시연금고객제안사례
Hy solution사례(2)즉시연금고객제안사례
 
[HY Solution]글로벌경기 긴급진단
[HY Solution]글로벌경기 긴급진단[HY Solution]글로벌경기 긴급진단
[HY Solution]글로벌경기 긴급진단
 
高崎経済大学の受験..
高崎経済大学の受験..高崎経済大学の受験..
高崎経済大学の受験..
 
L thn 4
L thn 4L thn 4
L thn 4
 
Di Bawah Bayang-bayang Krisis: Laporan Tahunan AJI 2015
Di Bawah Bayang-bayang Krisis: Laporan Tahunan AJI 2015Di Bawah Bayang-bayang Krisis: Laporan Tahunan AJI 2015
Di Bawah Bayang-bayang Krisis: Laporan Tahunan AJI 2015
 
Los mejores futbolistas europeos
Los mejores futbolistas europeosLos mejores futbolistas europeos
Los mejores futbolistas europeos
 
Management de communaute
Management de communauteManagement de communaute
Management de communaute
 
Looking at the wetware stakeholders in communities - fossa2011
Looking at the wetware   stakeholders in communities - fossa2011Looking at the wetware   stakeholders in communities - fossa2011
Looking at the wetware stakeholders in communities - fossa2011
 
After Blood Stains: The Killing of AA Prabangsa
After Blood Stains: The Killing of AA PrabangsaAfter Blood Stains: The Killing of AA Prabangsa
After Blood Stains: The Killing of AA Prabangsa
 

Semelhante a Cucaruba!

Wai Aria In Real World
Wai Aria In Real WorldWai Aria In Real World
Wai Aria In Real WorldGoonoo Kim
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deploymentbaremetal
 
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010Plataformatec
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3Hugo Baraúna
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scalebaremetal
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenchesjjggss
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Reusable View Components in Rails
Reusable View Components in RailsReusable View Components in Rails
Reusable View Components in RailsHarun Pathan
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manormartinbtt
 
Best Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesBest Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesAll Things Open
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Alberto Perdomo
 
Rack is Spectacular
Rack is SpectacularRack is Spectacular
Rack is SpectacularBryce Kerley
 
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Ontico
 
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)AvitoTech
 
The Real-Time Web (and Other Buzzwords)
The Real-Time Web (and Other Buzzwords)The Real-Time Web (and Other Buzzwords)
The Real-Time Web (and Other Buzzwords)err
 
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet LabsThe Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet LabsPuppet
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUKiwamu Okabe
 

Semelhante a Cucaruba! (20)

Wai Aria In Real World
Wai Aria In Real WorldWai Aria In Real World
Wai Aria In Real World
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deployment
 
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3
 
Modern Catalyst
Modern  CatalystModern  Catalyst
Modern Catalyst
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scale
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenches
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Reusable View Components in Rails
Reusable View Components in RailsReusable View Components in Rails
Reusable View Components in Rails
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
Best Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesBest Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion Pipelines
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
Rack is Spectacular
Rack is SpectacularRack is Spectacular
Rack is Spectacular
 
Sprockets
SprocketsSprockets
Sprockets
 
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
 
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
 
The Real-Time Web (and Other Buzzwords)
The Real-Time Web (and Other Buzzwords)The Real-Time Web (and Other Buzzwords)
The Real-Time Web (and Other Buzzwords)
 
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet LabsThe Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
 
Rails::Engine
Rails::EngineRails::Engine
Rails::Engine
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCU
 

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Cucaruba!

  • 1. Viva la Cucaruba! Matt Yoho @mattyoho
  • 2. CUCARUBA! MATT YOHO Integration testing for Rails gem plugins
  • 3. CUCARUBA! MATT YOHO Cucumber
  • 5. CUCARUBA! MATT YOHO cucumber features for command line apps
  • 6. CUCARUBA! MATT YOHO
  • 7. CUCARUBA! MATT YOHO YO DAWG! I heard you like features in your features so we put cukes in your cukes!
  • 8. CUCARUBA! MATT YOHO For example...
  • 9. CUCARUBA! MATT YOHO class WidgetController < AppController before_filter :find_widget, :only => [:show, :edit, :update] def find_widget @widget ||= Widget.find(params[:id]) end end
  • 10. CUCARUBA! MATT YOHO class WidgetController < AppController assume :widget end
  • 11. CUCARUBA! MATT YOHO class WidgetController < AppController def user_accout current_user.account end hide_action :user_account helper_method :user_account end
  • 12. CUCARUBA! MATT YOHO class WidgetController < AppController assume(:account) do current_user.account end end
  • 13. CUCARUBA! MATT YOHO Specs go a long way, but...
  • 14. CUCARUBA! MATT YOHO Specs go a long way, but... Rails dependencies, etc.
  • 15. CUCARUBA! MATT YOHO Yuck.
  • 16. CUCARUBA! MATT YOHO ~/projects/app/tmp/aruba
  • 17. CUCARUBA! MATT YOHO ~/projects/app/tmp/aruba ./tmp/aruba rake task
  • 18. CUCARUBA! MATT YOHO ~/projects/app/tmp/aruba templates ./tmp/aruba rake task
  • 19. CUCARUBA! MATT YOHO Feature: Rails Controllers Can Make Assumptions Scenario: controller invokes assume Given a file named "app/controllers/widgets_controller.rb" with: """ class WidgetsController < ApplicationController assume(:widget) { Widget.find(params[:id]) } end """ And a file named "app/views/widgets/show.html.erb" with: """ <blink><%= widget.name %></blink> """ And a file named "features/widget_is_viewed_by_visitor.feature" with: """ Feature: Widget is viewed by visitor Scenario: success Given a widget named "foobar" When I view the widget Then I should see "foobar" """ When I run "cucumber features/widget_is_viewed_by_visitor.feature" Then I should see: """ 1 scenario (1 passed) 3 steps """
  • 20. CUCARUBA! MATT YOHO Feature: Foo Does Something Scenario: foo works Given a file named "foo.feature" with: """ Feature: Widget is viewed by visitor Scenario: success Given a foo named "bar" When I view the foo Then I should see "bar" """ When I run "cucumber foo.feature" Then I should see: """ 1 scenario (1 passed) 1 step """
  • 21. CUCARUBA! MATT YOHO A little slow, but totally badass.
  • 23. CUCARUBA! MATT YOHO RVM and Bundler are complimentary
  • 24. CUCARUBA! MATT YOHO Be kind to your contributors
  • 25. CUCARUBA! MATT YOHO Get Forked
  • 26. CUCARUBA! MATT YOHO http://github.com/aslakhellesoy/aruba http://github.com/rspec/rspec- rails http://github.com/mattyoho/ basic_assumption

Notas do Editor

  1. What the heck is Cucaruba?!
  2. BDD integration testing framework
  3. Extension to Cucumber for command line apps
  4. Command line apps, eh...?
  5. RSpec is a command line app! Cucumber is a command line app!
  6. I heard you like features in your features so we put cukes in your cukes!
  7. A Rails gem plugin is a great thing to integration test. Particularly in an automated way.
  8. Common controller idiom.
  9. Much cleaner.
  10. Another common idiom.
  11. Cleaner again.
  12. Getting Rails components into your specs can be painful, and mocking them out entirely is asking for unpleasant surprises.
  13. It gets painful.
  14. Aruba operates in tmp/aruba relative to your project root. This directory must exist for Aruba to run!
  15. Rake tasks to set up a Rails app in the working directory.
  16. Copy in your templates or do other setup work to put the app into a testable state.
  17. Example Cucumber feature using Aruba steps. Aruba is oriented around file reads and writes and command line input and output.
  18. &amp;#x201C;foo.feature&amp;#x201D; will be created by Aruba.
  19. Just like a two-headed turtle.
  20. It makes for, at the least, a great some testing option.
  21. RVM gemsets and Bundler dependency management assist in automating the process of setting up a development sandbox for developing your library.
  22. This makes for a happier contributor experience...
  23. ...which leads to more contributors.
  24. Aruba itself, and a great example of using it can be found in rspec/rspec-rails. It also is used in BasicAssumption.