T S Vallender


Different people have different standards for the speed of unit tests and of their test suites. David Heinemeier Hansson is happy with a compile suite that takes a few seconds and a commit suite that takes a few minutes. Gary Bernhardt finds that unbearably slow, insisting on a compile suite of around 300ms and Dan Bodart doesn't want his commit suite to be more than ten seconds
From https://martinfowler.com/bliki/UnitTest.html

Working links:
I'm not a fan of most of RSpec's DSL, so appreciated this article from Test Double suggesting the use of Ruby 3's endless method syntax instead of using let.

def foo = bar.new
instead of
let foo { bar.new }

Not considered that before, and combined with using instance variables instead of let!, it reinforces and makes more obvious the difference.
Just learned RSpec has an :aggregate_failures option, to show all failures in specs with multiple assertions.
Added a helper script to a project that uses RSpec to replicate the default behaviour of Rails segregation of system tests and get faster feedback more easily.
RSpec has a --bisect option which attempts to automatically find the smallest combination of specs causing a failure (use in conjunction with --seed).