~/talk

Extremely Defensive Coding

Talkat RubyConf Portugal 2015 · 2015-09-14..09-15· [security]
slides:none on file

Explains how RSpec makes stubbing reliable by evolving method-handle retrieval from naive object.method calls to a layered approach: saving Kernel.instance_method(:method), attempting Kernel instance_method fallback, feature-detecting rebinding support per interpreter (MRI, JRuby), falling back to invoking and type-checking the user method, and a trust but verify policy for delegation edge cases like SimpleDelegator. The final implementation is large and messy but repeatedly proven to restore original methods and work across multiple Ruby VMs.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 2:11Story about overriding methods
  3. 4:59What makes a gem good
  4. 7:58RSpec mocking user story
  5. 10:50Ruby method objects explained
  6. 13:18Evolution of RSpec method handle
  7. 17:21Ruby users redefine methods
  8. 18:04Ruby interpreter differences
  9. 20:13RSpec multi-interpreter support
  10. 22:42Module method rebinding issues
  11. 23:24User-defined method delegation
  12. 24:47Final RSpec method handle implementation
  13. 25:08Why RSpec goes to extreme lengths
  14. 26:56Defensive coding in gems
  15. 28:22Gems as barriers of complexity
  16. 29:23Power and responsibility in Ruby
  17. 30:07Q&A session
~/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.