testing
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
- https://web.archive.org/web/20221222080746/https://dhh.dk/2014/slow-database-test-fallacy.html
- https://web.archive.org/web/20190329045845/https://www.destroyallsoftware.com/blog/2014/tdd-straw-men-and-rhetoric
- https://web.archive.org/web/20220124070115/http://dan.bodar.com/2012/02/28/crazy-fast-build-times-or-when-10-seconds-starts-to-make-you-nervous/
Tags:
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.
Tags:
Just learned RSpec has an :aggregate_failures option, to show all failures in specs with multiple assertions.
Tags:
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.
Tags:
RSpec has a --bisect option which attempts to automatically find the smallest combination of specs causing a failure (use in conjunction with --seed).