Minitest provides a complete suite of testing facilities supporting both TDD and BDD style testing, but also stubbing, mocking, and benchmark style testing that allow you to assert the performance of your algorithms regardless of what they’re run on. See the doco for more information and the full API or read about the history of minitest.
Minitest is fast. Damn fast. Faster than all the other full fledged test frameworks available for ruby.
Minitest is small. Damn small. You can sit down and read through the entirety of the code in about an hour.
Minitest is used by the biggest shops: github, shopify, zendesk, stripe and by some of the most popular projects: rails, rack, nokogiri, arel, tzinfo...
# BDD: # TDD: describe Thingy do class TestThingy < Minitest::Test before do def setup do_some_setup super end do_some_setup end it "should do the first thing" do def test_first_thing _(1).must_equal 1 assert_equal 1, 1 end end end describe SubThingy do class TestSubThingy < TestThingy before do def setup do_more_setup super end do_more_setup end it "should do the second thing" do def test_second_thing _(2).must_equal 2 assert_equal 2, 2 end end end end end
These two forms are almost entirely equivalent. The Spec form generates (roughly) the Test form. The differences center mainly around class/method inheritance and how expectations work indirectly. Mostly details you can ignore.
TODO: related stuff/packages (like a minitest emacs mode)