~/talk

RSpec: The Bad Parts

Talkat RubyConf 2022 · 2022-11-29..12-01· [testing]
slides:none on file

Claims that RSpec macros are the problem not the language and demonstrates concrete fixes: a real 4,500-line file contains 531 let definitions across 131 method names (78 overridden, some redefined up to 69 times) and 87 subject defs, consuming ~14% of the file; examples come from Ruby on Rails and Mastodon tests. Refactors replace lets with Ruby methods or instance vars and use the inline method refactor, flatten contexts, inline before blocks, and run the suite — tests continue to pass.

AI-written summary · about

  1. 0:00Introduction
  2. 1:45RSpec let and subject
  3. 3:29Problems with let and subject
  4. 7:49Refactoring let and subject
  5. 10:17DRY in test setup
  6. 13:21Refactoring Rails test
  7. 17:32Issues with before blocks
  8. 19:37Shared examples dangers
  9. 20:41Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.