Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class Proxy def initialize(target_object) @object = target_object @messages = [] end def method_missing(method_name, *args, &block) @messages.push method_name @object.send method_name, *args, &block end def messages @messages end def called?(method_name) @messages.include? method_name end def number_of_times_called(method_name) @messages.select {|x| x == method_name}.size end end
This paste will be private.
From the Design Piracy series on my blog: