Skip to content

Instantly share code, notes, and snippets.

@abyx
Created February 4, 2012 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abyx/1737631 to your computer and use it in GitHub Desktop.
Save abyx/1737631 to your computer and use it in GitHub Desktop.
commentor.should_receive(:add).with(anonymous_comment)
# This
response['X-Runtime'].should =~ /[\d\.]+/
# .. or this?
response['X-Runtime'].should be_a_number
RSpec::Matchers.define :be_a_multiple_of do |expected|
match do |actual|
actual % expected == 0
end
end
expected_comment = Comment.new(anonymous: true, user: "the dude", reply_to: nil)
commentor.should_receive(:add).with(expected_comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment