public
Last active

  • Download Gist
beautiful_and_dry.rb
Ruby
1
commentor.should_receive(:add).with(anonymous_comment)
intent.rb
Ruby
1 2 3 4 5
# This
response['X-Runtime'].should =~ /[\d\.]+/
 
# .. or this?
response['X-Runtime'].should be_a_number
rspec_matcher.rb
Ruby
1 2 3 4 5
RSpec::Matchers.define :be_a_multiple_of do |expected|
match do |actual|
actual % expected == 0
end
end
sucky_non_dry.rb
Ruby
1 2
expected_comment = Comment.new(anonymous: true, user: "the dude", reply_to: nil)
commentor.should_receive(:add).with(expected_comment)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.