to write and maintain tests • Run tests in random order • Believe me, this will find bugs in your code • Make you focus on testing your code and not learning the framework yourself
suites • MiniTest is notably faster on smaller tests suites • RSpec will continue to slow down rapidly because matchers create objects which trigger garbage collection • Developers may notice a difference in typical test suites
is a class so `Person.new` is called # implicitly before each test and assigned to # `subject` describe Person do its(:phone_number) { should =~ /^\d+$/ } end
= read "site/application.js" assert_includes content, "APP" assert_includes content, "VENDOR" assert content.index("VENDOR") < content.index("APP"), "Vendor should come before App!" end
end def assert_before(source, first, second) assert_includes content, first assert_includes content, second assert content.index(first) < content.index(source), "#{first} should be before #{second}" end
Removing a complex mocking/stubbing library makes you consider design • Run tests in random order--this will usually find bugs in your test suite or code • Can run your tests in parallel
Its much easier to understand and extend • Random & parallel tests out of the box • Its part of the standard library so it’s available everywhere • More stable and better supported than Rspec • It will make your test suite better!