SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

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

Hinweis der Redaktion

  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.