SlideShare a Scribd company logo
1 of 24
Download to read offline
Chiew Chung        @theworldinunion
Edward Middleton   @e14n
'rspec/core/rake_task'
RSpec.configure do |c|
   # ....




command line
./.rspec
~/.rspec
describe "something" do
 context "in some context" do
  it "does something" do
    # ...
  end
 end
end
# in spec/spec_helper.rb
RSpec.configure do |c|
 c.filter_run :focus => true
end

# in any spec file
describe "something" do
 it "does something", :focus => true do
   # ....
 end
end
RSpec.configure do |c|
 c.filter_run :focus => true
 c.run_all_when_everything_filtered = true
end
# in spec/spec_helper.rb
RSpec.configure do |c|
 c.exclusion_filter = { :ruby => lambda {|version|
  !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
 }}
end

# in any spec file
describe "something" do
 it "does something", :ruby => 1.8 do
   # ....
 end

 it "does something", :ruby => 1.9 do
   # ....
 end
end
actual.should == expected # object equality
actual.should equal(expected) # object identity




actual.should eq(expected) # object equality
actual.should be(expected) # object identity
def eat_cheese
 simple_matcher("eat cheese") do |actual|
  actual.eat?(:cheese)
 end
end



RSpec::Matchers.define :eat_cheese do
 match do |actual|
  actual.eat?(:cheese)
 end
end
RSpec::Matchers.define :eat_cheese do
 match do |actual|
  actual.should eat?(:cheese)
 end
end

RSpec::Matchers.define :eat_cheese do
 include MyCheesyAssertions
 match_unless_raises
Test::Unit::AssertionFailedError do |actual|
  assert_eats_chesse actual
 end
end
RSpec 1.x -> 2.0 の変更点

More Related Content

What's hot

Extracting ruby gem
Extracting ruby gemExtracting ruby gem
Extracting ruby gemYura Tolstik
 
DataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
DataEngConf SF16 - Routing Billions of Analytics Events with High DeliverabilityDataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
DataEngConf SF16 - Routing Billions of Analytics Events with High DeliverabilityHakka Labs
 
搭建高品質開源項目的應用實踐
搭建高品質開源項目的應用實踐搭建高品質開源項目的應用實踐
搭建高品質開源項目的應用實踐Shengyou Fan
 
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingGianluca Arbezzano
 
Explore the Rake Gem
Explore the Rake GemExplore the Rake Gem
Explore the Rake GemRudy R. Yazdi
 
Break through the serverless barriers with Durable Functions
Break through the serverless barriers with Durable FunctionsBreak through the serverless barriers with Durable Functions
Break through the serverless barriers with Durable FunctionsMicrosoft Tech Community
 

What's hot (9)

Extracting ruby gem
Extracting ruby gemExtracting ruby gem
Extracting ruby gem
 
My GAE apps.
My GAE apps.My GAE apps.
My GAE apps.
 
DataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
DataEngConf SF16 - Routing Billions of Analytics Events with High DeliverabilityDataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
DataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
 
Auto Build
Auto BuildAuto Build
Auto Build
 
搭建高品質開源項目的應用實踐
搭建高品質開源項目的應用實踐搭建高品質開源項目的應用實踐
搭建高品質開源項目的應用實踐
 
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
 
Explore the Rake Gem
Explore the Rake GemExplore the Rake Gem
Explore the Rake Gem
 
Break through the serverless barriers with Durable Functions
Break through the serverless barriers with Durable FunctionsBreak through the serverless barriers with Durable Functions
Break through the serverless barriers with Durable Functions
 
bengar
bengarbengar
bengar
 

Viewers also liked

ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...Kostas Diamantaras
 
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDA
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDAΣύντομη εισαγωγή στην τεχνολογία GPU και την CUDA
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDAKostas Diamantaras
 
Implicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaImplicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaccmundocontemporaneo
 
FlexUnit4でテスト駆動開発
FlexUnit4でテスト駆動開発FlexUnit4でテスト駆動開発
FlexUnit4でテスト駆動開発theworldinunion
 
Ek4
Ek4Ek4
Ek4hrb1
 
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computing
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computingΜοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computing
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computingKostas Diamantaras
 
Swiz フレームワーク for Flex and Actionscript
Swiz フレームワーク for Flex and ActionscriptSwiz フレームワーク for Flex and Actionscript
Swiz フレームワーク for Flex and Actionscripttheworldinunion
 
Implicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaImplicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaccmundocontemporaneo
 
Implicacións eticas pegada_xenetica
Implicacións eticas pegada_xeneticaImplicacións eticas pegada_xenetica
Implicacións eticas pegada_xeneticaccmundocontemporaneo
 
Σύντομη εισαγωγή στο MapReduce
Σύντομη εισαγωγή στο MapReduceΣύντομη εισαγωγή στο MapReduce
Σύντομη εισαγωγή στο MapReduceKostas Diamantaras
 

Viewers also liked (16)

Read 96
Read 96Read 96
Read 96
 
Orixe humanos
Orixe humanosOrixe humanos
Orixe humanos
 
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
 
A célula e o adn
A célula   e o  adnA célula   e o  adn
A célula e o adn
 
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDA
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDAΣύντομη εισαγωγή στην τεχνολογία GPU και την CUDA
Σύντομη εισαγωγή στην τεχνολογία GPU και την CUDA
 
Cosmovisão guia 01
Cosmovisão guia 01Cosmovisão guia 01
Cosmovisão guia 01
 
Flak
FlakFlak
Flak
 
Implicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaImplicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenética
 
Xeomorfoloxia
XeomorfoloxiaXeomorfoloxia
Xeomorfoloxia
 
FlexUnit4でテスト駆動開発
FlexUnit4でテスト駆動開発FlexUnit4でテスト駆動開発
FlexUnit4でテスト駆動開発
 
Ek4
Ek4Ek4
Ek4
 
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computing
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computingΜοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computing
Μοντέλο Client/Server, Διαδικτυακές υπηρεσίες και Cloud computing
 
Swiz フレームワーク for Flex and Actionscript
Swiz フレームワーク for Flex and ActionscriptSwiz フレームワーク for Flex and Actionscript
Swiz フレームワーク for Flex and Actionscript
 
Implicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenéticaImplicacións éticas do coñecemento da pegada xenética
Implicacións éticas do coñecemento da pegada xenética
 
Implicacións eticas pegada_xenetica
Implicacións eticas pegada_xeneticaImplicacións eticas pegada_xenetica
Implicacións eticas pegada_xenetica
 
Σύντομη εισαγωγή στο MapReduce
Σύντομη εισαγωγή στο MapReduceΣύντομη εισαγωγή στο MapReduce
Σύντομη εισαγωγή στο MapReduce
 

Similar to RSpec 1.x -> 2.0 の変更点

RSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversRSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversBrian Gesiak
 
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, Puppet
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, PuppetPuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, Puppet
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, PuppetPuppet
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and SpeedSalesforce Marketing Cloud
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Coxlachie
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends旻琦 潘
 
Complet vector.dep.inc# This code depends on make tool being .docx
Complet vector.dep.inc# This code depends on make tool being .docxComplet vector.dep.inc# This code depends on make tool being .docx
Complet vector.dep.inc# This code depends on make tool being .docxardhowp
 
Ruby on Rails - Introduction
Ruby on Rails - IntroductionRuby on Rails - Introduction
Ruby on Rails - IntroductionVagmi Mudumbai
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101bokonen
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?Tushar Sharma
 
name name2 n
name name2 nname name2 n
name name2 ncallroom
 
name name2 n2
name name2 n2name name2 n2
name name2 n2callroom
 
name name2 n
name name2 nname name2 n
name name2 ncallroom
 
name name2 n
name name2 nname name2 n
name name2 ncallroom
 
name name2 n2.ppt
name name2 n2.pptname name2 n2.ppt
name name2 n2.pptcallroom
 

Similar to RSpec 1.x -> 2.0 の変更点 (20)

RSpec 3.0: Under the Covers
RSpec 3.0: Under the CoversRSpec 3.0: Under the Covers
RSpec 3.0: Under the Covers
 
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, Puppet
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, PuppetPuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, Puppet
PuppetConf 2017: Puppet Tasks: Taming ssh in a "for" loop- Alex Dreyer, Puppet
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
 
Complet vector.dep.inc# This code depends on make tool being .docx
Complet vector.dep.inc# This code depends on make tool being .docxComplet vector.dep.inc# This code depends on make tool being .docx
Complet vector.dep.inc# This code depends on make tool being .docx
 
Ruby on Rails - Introduction
Ruby on Rails - IntroductionRuby on Rails - Introduction
Ruby on Rails - Introduction
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
ppt7
ppt7ppt7
ppt7
 
ppt2
ppt2ppt2
ppt2
 
name name2 n
name name2 nname name2 n
name name2 n
 
name name2 n2
name name2 n2name name2 n2
name name2 n2
 
test ppt
test ppttest ppt
test ppt
 
name name2 n
name name2 nname name2 n
name name2 n
 
ppt21
ppt21ppt21
ppt21
 
name name2 n
name name2 nname name2 n
name name2 n
 
ppt17
ppt17ppt17
ppt17
 
ppt30
ppt30ppt30
ppt30
 
name name2 n2.ppt
name name2 n2.pptname name2 n2.ppt
name name2 n2.ppt
 

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiRaviKumarDaparthi
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 

Recently uploaded (20)

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 

RSpec 1.x -> 2.0 の変更点

  • 1. Chiew Chung @theworldinunion Edward Middleton @e14n
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10.
  • 11. RSpec.configure do |c| # .... command line ./.rspec ~/.rspec
  • 12. describe "something" do context "in some context" do it "does something" do # ... end end end
  • 13.
  • 14.
  • 15. # in spec/spec_helper.rb RSpec.configure do |c| c.filter_run :focus => true end # in any spec file describe "something" do it "does something", :focus => true do # .... end end
  • 16. RSpec.configure do |c| c.filter_run :focus => true c.run_all_when_everything_filtered = true end
  • 17. # in spec/spec_helper.rb RSpec.configure do |c| c.exclusion_filter = { :ruby => lambda {|version| !(RUBY_VERSION.to_s =~ /^#{version.to_s}/) }} end # in any spec file describe "something" do it "does something", :ruby => 1.8 do # .... end it "does something", :ruby => 1.9 do # .... end end
  • 18.
  • 19.
  • 20. actual.should == expected # object equality actual.should equal(expected) # object identity actual.should eq(expected) # object equality actual.should be(expected) # object identity
  • 21.
  • 22. def eat_cheese simple_matcher("eat cheese") do |actual| actual.eat?(:cheese) end end RSpec::Matchers.define :eat_cheese do match do |actual| actual.eat?(:cheese) end end
  • 23. RSpec::Matchers.define :eat_cheese do match do |actual| actual.should eat?(:cheese) end end RSpec::Matchers.define :eat_cheese do include MyCheesyAssertions match_unless_raises Test::Unit::AssertionFailedError do |actual| assert_eats_chesse actual end end