Skip to content

Instantly share code, notes, and snippets.

@andrewbroman
Created July 10, 2012 15:37
Show Gist options
  • Save andrewbroman/3084151 to your computer and use it in GitHub Desktop.
Save andrewbroman/3084151 to your computer and use it in GitHub Desktop.
Ruby: on-the-fly mock
# Thanks to tenderlove on Peepcode play by play
tc = self
klass = Class.new(Client) do
define_method(:get) do |username|
tc.assert_equal 'foobar', username
sample
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment