~/talk

An Introduction to Spies in RSpec

Talkat RubyConf 2014 · 2014-11-17..11-19· [testing]
slides:none on file

Spies in RSpec record method calls so tests assert interactions after actions rather than before, using spy method handles and matchers like have_received and exactly(4).times. A small counter client proving HTTP counts is built and shown first with slow integration tests then refactored to accept an injected http client so doubles, mocks and finally a spy verify get requests without monkeypatching lhttp. Tests pass and runtime drops when network calls are removed.

AI-written summary · about

  1. 0:00Start
  2. 8:02Integrated Test
  3. 9:08Isolated Test
  4. 10:24Coupling
  5. 15:44Live Coding
  6. 26:05Fixing the Implementation
~/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.