SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
Minitest
Raphael Monteiro
Bankfacil
18/02/2015
Summary
● What is Minitest?
● Minitest vs Rspec
● Main assertions (syntax)
● Reasons to use Minitest
● Minitest into Rails
● Minitest into Bankfacil
● Further...
What is Minitest?
Minitest provides a complete suite of testing
facilities.
● minitest/unit
● minitest/spec
● minitest/benchmark
● minitest/mock
● minitest/pride
Minitest vs Rspec
● "rspec is a testing DSL. minitest is ruby." - Adam
Hawkins, "Bow Before Minitest"
● "Rspec is not about testing - it's about
documentation. That's why I prefer it" - Rahoul
Baruah
Main assertions (syntax)
● stub e mock
test 'execute' do
mock = Minitest::Mock.new
LeadToBkfApplicationCreator.stub(:new, mock,
lead_icarros) do
mock.expect(:create, true)
@ruler.execute(lead_icarros)
end
assert mock.verify
end
● more ex:
Reasons to use minitest
● Faster and lighter than Rspec
● It is Ruby, no magic
● Random & parallel tests
● It is part of Ruby and Rails
Minitest into Rails
● Since version 1.9, Ruby provides Minitest
● test folder
● setup and teardown methods
● fixtures
# lo & behold! I am a YAML comment!
david:
name: David Heinemeier Hansson
birthday: 1979-10-15
profession: Systems development
● rake test
Minitest into Bankfacil
● auto_financing project
● assertions not spec
● minitest-focus
● minitest-reporters
class MyTest < MiniTest::Unit::TestCase
def test_unrelated; ...; end
focus
def test_method; ...; end # only
this one will run
def test_method_edgecase; ...; end
end
Further...
● Official website: https://github.com/seattlerb/minitest
● Ruby on Rails guides: http://guides.rubyonrails.org/v3.2.13/testing.html
● Bow Before Minitest by Adam Hawkins: https://speakerdeck.
com/ahawkins/bow-before-minitest
● RubyInside: http://www.rubyinside.com/dhh-offended-by-rspec-debate-4610.
html
● Minitest Quick Reference: http://www.mattsears.
com/articles/2011/12/10/minitest-quick-reference
● 7 Reasons I’m sticking with minitest: http://brandonhilkert.com/blog/7-reasons-
why-im-sticking-with-minitest-and-fixtures-in-rails/
● 7 Reasons I love minitest: https://blog.engineyard.com/2014/seven-reasons-i-
love-minitest

Contenu connexe

Tendances

A small post about the Casablanca project
A small post about the Casablanca projectA small post about the Casablanca project
A small post about the Casablanca projectPVS-Studio
 
PuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgPuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgRichard Pijnenburg
 
PHP Aberdeen Quick optimisation of PHP with Webgrind
PHP Aberdeen Quick optimisation of PHP with WebgrindPHP Aberdeen Quick optimisation of PHP with Webgrind
PHP Aberdeen Quick optimisation of PHP with WebgrindAndy_Gaskell
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTWaqqas Jabbar
 

Tendances (7)

A small post about the Casablanca project
A small post about the Casablanca projectA small post about the Casablanca project
A small post about the Casablanca project
 
PuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgPuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard Pijnenburg
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
PHP Aberdeen Quick optimisation of PHP with Webgrind
PHP Aberdeen Quick optimisation of PHP with WebgrindPHP Aberdeen Quick optimisation of PHP with Webgrind
PHP Aberdeen Quick optimisation of PHP with Webgrind
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUST
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
 
Ruby on rails rspec
Ruby on rails rspecRuby on rails rspec
Ruby on rails rspec
 

Similaire à Minitest

Unit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming RubyUnit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming Rubylvrubygroup
 
Of Microservices and Microservices - Robert Munteanu
Of Microservices and Microservices -  Robert MunteanuOf Microservices and Microservices -  Robert Munteanu
Of Microservices and Microservices - Robert Munteanumfrancis
 
Of microservices and microservices
Of microservices and microservicesOf microservices and microservices
Of microservices and microservicesRobert Munteanu
 
Apache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayApache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayRobert Munteanu
 
Benchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersBenchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersJustin Dorfman
 
Benchmarks, performance, scalability, and capacity what s behind the numbers...
Benchmarks, performance, scalability, and capacity  what s behind the numbers...Benchmarks, performance, scalability, and capacity  what s behind the numbers...
Benchmarks, performance, scalability, and capacity what s behind the numbers...james tong
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet SystemPuppet
 
Testing and Software Writer a year later
Testing and Software Writer a year laterTesting and Software Writer a year later
Testing and Software Writer a year laterSimon Bagreev
 
Whoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustWhoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustScyllaDB
 
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)Linaro
 
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)Linaro
 
Yet Another Continuous Integration Story
Yet Another Continuous Integration StoryYet Another Continuous Integration Story
Yet Another Continuous Integration StoryAnton Serdyuk
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StoryNathanial McConnell
 
Ruby/rails performance and profiling
Ruby/rails performance and profilingRuby/rails performance and profiling
Ruby/rails performance and profilingDanny Guinther
 
Elephant Carpaccio
Elephant CarpaccioElephant Carpaccio
Elephant CarpaccioLars Thorup
 

Similaire à Minitest (20)

Unit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming RubyUnit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming Ruby
 
Presentacion minitest
Presentacion minitestPresentacion minitest
Presentacion minitest
 
Of Microservices and Microservices - Robert Munteanu
Of Microservices and Microservices -  Robert MunteanuOf Microservices and Microservices -  Robert Munteanu
Of Microservices and Microservices - Robert Munteanu
 
Of microservices and microservices
Of microservices and microservicesOf microservices and microservices
Of microservices and microservices
 
Apache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayApache Sling as a Microservices Gateway
Apache Sling as a Microservices Gateway
 
Benchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbersBenchmarks, performance, scalability, and capacity what's behind the numbers
Benchmarks, performance, scalability, and capacity what's behind the numbers
 
Benchmarks, performance, scalability, and capacity what s behind the numbers...
Benchmarks, performance, scalability, and capacity  what s behind the numbers...Benchmarks, performance, scalability, and capacity  what s behind the numbers...
Benchmarks, performance, scalability, and capacity what s behind the numbers...
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet system
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet System
 
Testing and Software Writer a year later
Testing and Software Writer a year laterTesting and Software Writer a year later
Testing and Software Writer a year later
 
Whoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustWhoops! I Rewrote It in Rust
Whoops! I Rewrote It in Rust
 
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (I)
 
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)
LCE13: Test and Validation Summit: Evolution of Testing in Linaro (II)
 
Yet Another Continuous Integration Story
Yet Another Continuous Integration StoryYet Another Continuous Integration Story
Yet Another Continuous Integration Story
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the Story
 
Ruby/rails performance and profiling
Ruby/rails performance and profilingRuby/rails performance and profiling
Ruby/rails performance and profiling
 
Feature toggling
Feature togglingFeature toggling
Feature toggling
 
Tdd Primer
Tdd PrimerTdd Primer
Tdd Primer
 
Elephant Carpaccio
Elephant CarpaccioElephant Carpaccio
Elephant Carpaccio
 

Plus de Creditas

Hanami & Domain-Driven Design
Hanami & Domain-Driven DesignHanami & Domain-Driven Design
Hanami & Domain-Driven DesignCreditas
 
Application layer
Application layerApplication layer
Application layerCreditas
 
Hanami with a modern touch
Hanami with a modern touchHanami with a modern touch
Hanami with a modern touchCreditas
 
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!Creditas
 
How To Get Organized
How To Get OrganizedHow To Get Organized
How To Get OrganizedCreditas
 
O que o seu texto diz sobre você
O que o seu texto diz sobre vocêO que o seu texto diz sobre você
O que o seu texto diz sobre vocêCreditas
 
Modern sql
Modern sqlModern sql
Modern sqlCreditas
 
Positive reinforcement and statistics
Positive reinforcement and statisticsPositive reinforcement and statistics
Positive reinforcement and statisticsCreditas
 
Text mining Pre-processing
Text mining Pre-processingText mining Pre-processing
Text mining Pre-processingCreditas
 
Melanoma: how to detect skin cancer
Melanoma: how to detect skin cancerMelanoma: how to detect skin cancer
Melanoma: how to detect skin cancerCreditas
 
Rails Girls - RubyConfBR 2015
Rails Girls - RubyConfBR 2015Rails Girls - RubyConfBR 2015
Rails Girls - RubyConfBR 2015Creditas
 
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefe
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefeComo melhorar sua comunicação com sua equipe, sua mãe e seu chefe
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefeCreditas
 
O paradoxo da escolha
O paradoxo da escolhaO paradoxo da escolha
O paradoxo da escolhaCreditas
 
A arte de ser Mensch
A arte de ser MenschA arte de ser Mensch
A arte de ser MenschCreditas
 
An introduction to MySQL
An introduction to MySQLAn introduction to MySQL
An introduction to MySQLCreditas
 
GTD - Getting Things Done
GTD - Getting Things DoneGTD - Getting Things Done
GTD - Getting Things DoneCreditas
 
Pig - Analyzing data sets
Pig - Analyzing data setsPig - Analyzing data sets
Pig - Analyzing data setsCreditas
 
Learning how to learn
Learning how to learnLearning how to learn
Learning how to learnCreditas
 
OOCSS and SMACSS
OOCSS and SMACSSOOCSS and SMACSS
OOCSS and SMACSSCreditas
 

Plus de Creditas (20)

Hanami & Domain-Driven Design
Hanami & Domain-Driven DesignHanami & Domain-Driven Design
Hanami & Domain-Driven Design
 
Application layer
Application layerApplication layer
Application layer
 
Hanami with a modern touch
Hanami with a modern touchHanami with a modern touch
Hanami with a modern touch
 
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!
Jurassic JavaScript Park - Rodando Offline até na ilha Nublar!
 
How To Get Organized
How To Get OrganizedHow To Get Organized
How To Get Organized
 
O que o seu texto diz sobre você
O que o seu texto diz sobre vocêO que o seu texto diz sobre você
O que o seu texto diz sobre você
 
Modern sql
Modern sqlModern sql
Modern sql
 
Positive reinforcement and statistics
Positive reinforcement and statisticsPositive reinforcement and statistics
Positive reinforcement and statistics
 
Text mining Pre-processing
Text mining Pre-processingText mining Pre-processing
Text mining Pre-processing
 
Melanoma: how to detect skin cancer
Melanoma: how to detect skin cancerMelanoma: how to detect skin cancer
Melanoma: how to detect skin cancer
 
Rails Girls - RubyConfBR 2015
Rails Girls - RubyConfBR 2015Rails Girls - RubyConfBR 2015
Rails Girls - RubyConfBR 2015
 
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefe
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefeComo melhorar sua comunicação com sua equipe, sua mãe e seu chefe
Como melhorar sua comunicação com sua equipe, sua mãe e seu chefe
 
O paradoxo da escolha
O paradoxo da escolhaO paradoxo da escolha
O paradoxo da escolha
 
A arte de ser Mensch
A arte de ser MenschA arte de ser Mensch
A arte de ser Mensch
 
An introduction to MySQL
An introduction to MySQLAn introduction to MySQL
An introduction to MySQL
 
GTD - Getting Things Done
GTD - Getting Things DoneGTD - Getting Things Done
GTD - Getting Things Done
 
Pig - Analyzing data sets
Pig - Analyzing data setsPig - Analyzing data sets
Pig - Analyzing data sets
 
Neo4 j
Neo4 jNeo4 j
Neo4 j
 
Learning how to learn
Learning how to learnLearning how to learn
Learning how to learn
 
OOCSS and SMACSS
OOCSS and SMACSSOOCSS and SMACSS
OOCSS and SMACSS
 

Dernier

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 

Dernier (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 

Minitest

  • 2. Summary ● What is Minitest? ● Minitest vs Rspec ● Main assertions (syntax) ● Reasons to use Minitest ● Minitest into Rails ● Minitest into Bankfacil ● Further...
  • 3. What is Minitest? Minitest provides a complete suite of testing facilities. ● minitest/unit ● minitest/spec ● minitest/benchmark ● minitest/mock ● minitest/pride
  • 4. Minitest vs Rspec ● "rspec is a testing DSL. minitest is ruby." - Adam Hawkins, "Bow Before Minitest" ● "Rspec is not about testing - it's about documentation. That's why I prefer it" - Rahoul Baruah
  • 5. Main assertions (syntax) ● stub e mock test 'execute' do mock = Minitest::Mock.new LeadToBkfApplicationCreator.stub(:new, mock, lead_icarros) do mock.expect(:create, true) @ruler.execute(lead_icarros) end assert mock.verify end ● more ex:
  • 6. Reasons to use minitest ● Faster and lighter than Rspec ● It is Ruby, no magic ● Random & parallel tests ● It is part of Ruby and Rails
  • 7. Minitest into Rails ● Since version 1.9, Ruby provides Minitest ● test folder ● setup and teardown methods ● fixtures # lo & behold! I am a YAML comment! david: name: David Heinemeier Hansson birthday: 1979-10-15 profession: Systems development ● rake test
  • 8. Minitest into Bankfacil ● auto_financing project ● assertions not spec ● minitest-focus ● minitest-reporters class MyTest < MiniTest::Unit::TestCase def test_unrelated; ...; end focus def test_method; ...; end # only this one will run def test_method_edgecase; ...; end end
  • 9. Further... ● Official website: https://github.com/seattlerb/minitest ● Ruby on Rails guides: http://guides.rubyonrails.org/v3.2.13/testing.html ● Bow Before Minitest by Adam Hawkins: https://speakerdeck. com/ahawkins/bow-before-minitest ● RubyInside: http://www.rubyinside.com/dhh-offended-by-rspec-debate-4610. html ● Minitest Quick Reference: http://www.mattsears. com/articles/2011/12/10/minitest-quick-reference ● 7 Reasons I’m sticking with minitest: http://brandonhilkert.com/blog/7-reasons- why-im-sticking-with-minitest-and-fixtures-in-rails/ ● 7 Reasons I love minitest: https://blog.engineyard.com/2014/seven-reasons-i- love-minitest