SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
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 の変更点

Contenu connexe

Tendances

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
 

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

En vedette

ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...
ΤΕΙ Θεσσαλονίκης, Τμήμα Μηχανικών Πληροφορικής: Μεταπτυχιακό Πρόγραμμα Σπουδώ...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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
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
 
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
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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
 
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
 
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...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

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