Successfully reported this slideshow.
You’ve unlocked unlimited downloads on SlideShare!
● What is Minitest?
● Minitest vs Rspec
● Main assertions (syntax)
● Reasons to use Minitest
● Minitest into Rails
● Minitest into Bankfacil
What is Minitest?
Minitest provides a complete suite of testing
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
Main assertions (syntax)
● stub e mock
test 'execute' do
mock = Minitest::Mock.new
● 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
# lo & behold! I am a YAML comment!
name: David Heinemeier Hansson
profession: Systems development
● rake test
Minitest into Bankfacil
● auto_financing project
● assertions not spec
class MyTest < MiniTest::Unit::TestCase
def test_unrelated; ...; end
def test_method; ...; end # only
this one will run
def test_method_edgecase; ...; end
● 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.
● RubyInside: http://www.rubyinside.com/dhh-offended-by-rspec-debate-4610.
● Minitest Quick Reference: http://www.mattsears.
● 7 Reasons I’m sticking with minitest: http://brandonhilkert.com/blog/7-reasons-
● 7 Reasons I love minitest: https://blog.engineyard.com/2014/seven-reasons-i-
A presentation about Minitest. A suite for testing in Ruby.