Skip to content

Instantly share code, notes, and snippets.

@developwithpassion
Created February 27, 2012 17:27
Show Gist options
  • Save developwithpassion/1925656 to your computer and use it in GitHub Desktop.
Save developwithpassion/1925656 to your computer and use it in GitHub Desktop.
RSpec Matchers for developwithpassion_fakes
module RSpec
Matchers.define :have_received do|symbol,*args|
match do|fake|
result = true
method = fake.received(symbol)
result &= method != nil
unless (args.count == 0)
result &= method.called_with(*args) != nil
end
result
end
end
Matchers.define :never_received do|symbol|
match do|fake|
fake.never_received?(symbol)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment