~/talk

Mocking with Swift

Talkat FrenchKit 2017 · 2017-09-22..09-23· [testing]
slides:none on file

Explains why mocking in Swift is awkward, shows concrete refactors: add dependency injection and program to a protocol so NotificationCenter can be swapped, build a hand‑rolled mock that records calls then demonstrate its limits, and then replace it with Sorcery generating AutoMockable types so tests use generated mocks instead of 30–100 lines of boilerplate; shows Quick and Nimble are used and reports this codegen is used in production on the Jinyu Scan codebase.

AI-written summary · about

  1. 0:00Intro
  2. 0:20Why Swift
  3. 0:55Cheese
  4. 2:17Testing
  5. 3:15Object Interaction
  6. 3:43Dependency Injection
  7. 6:18Program to Interface
  8. 8:22Implementation
  9. 10:07Test
  10. 11:24More Powerful Mock
  11. 13:56Limitations of ManualMax
  12. 17:38Autogenerated Tests
  13. 19:31Conclusion
~/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.