Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Minitest
Raphael Monteiro
Bankfacil
18/02/2015
Summary
● What is Minitest?
● Minitest vs Rspec
● Main assertions (syntax)
● Reasons to use Minitest
● Minitest into Rails...
What is Minitest?
Minitest provides a complete suite of testing
facilities.
● minitest/unit
● minitest/spec
● minitest/ben...
Minitest vs Rspec
● "rspec is a testing DSL. minitest is ruby." - Adam
Hawkins, "Bow Before Minitest"
● "Rspec is not abou...
Main assertions (syntax)
● stub e mock
test 'execute' do
mock = Minitest::Mock.new
LeadToBkfApplicationCreator.stub(:new, ...
Reasons to use minitest
● Faster and lighter than Rspec
● It is Ruby, no magic
● Random & parallel tests
● It is part of R...
Minitest into Rails
● Since version 1.9, Ruby provides Minitest
● test folder
● setup and teardown methods
● fixtures
# lo...
Minitest into Bankfacil
● auto_financing project
● assertions not spec
● minitest-focus
● minitest-reporters
class MyTest ...
Further...
● Official website: https://github.com/seattlerb/minitest
● Ruby on Rails guides: http://guides.rubyonrails.org...
Upcoming SlideShare
Loading in …5
×

0

Share

Download to read offline

Minitest

Download to read offline

A presentation about Minitest. A suite for testing in Ruby.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Minitest

  1. 1. Minitest Raphael Monteiro Bankfacil 18/02/2015
  2. 2. Summary ● What is Minitest? ● Minitest vs Rspec ● Main assertions (syntax) ● Reasons to use Minitest ● Minitest into Rails ● Minitest into Bankfacil ● Further...
  3. 3. What is Minitest? Minitest provides a complete suite of testing facilities. ● minitest/unit ● minitest/spec ● minitest/benchmark ● minitest/mock ● minitest/pride
  4. 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. 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. 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. 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. 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. 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

A presentation about Minitest. A suite for testing in Ruby.

Views

Total views

813

On Slideshare

0

From embeds

0

Number of embeds

14

Actions

Downloads

2

Shares

0

Comments

0

Likes

0

×