SlideShare una empresa de 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

Más contenido relacionado

Destacado

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
 

Destacado (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
 

Similar 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
 

Similar 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

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Último (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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 New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

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 del 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.