Skip to content

Instantly share code, notes, and snippets.

@Haar
Created October 17, 2013 13:31
Show Gist options
  • Save Haar/7024967 to your computer and use it in GitHub Desktop.
Save Haar/7024967 to your computer and use it in GitHub Desktop.
Arbitrary property mocking sample in Ruby
class Mock
def initialize(property_hash)
@property_hash = property_hash
end
def method_missing(*args)
@property_hash[args.first] || ''
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment