Created
June 8, 2011 13:50
-
-
Save cutalion/1014456 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./spec/spec_helper.rb | |
# | |
# Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} | |
# | |
# | |
# Usage: | |
# | |
# its(:updated_at) { should be_the_same_time_as updated_at } | |
# | |
# | |
# Will pass or fail with message like: | |
# | |
# Failure/Error: its(:updated_at) { should be_the_same_time_as 2.days.ago } | |
# expected Tue, 07 Jun 2011 16:14:09 +0300 to be the same time as Mon, 06 Jun 2011 13:14:09 UTC +00:00 | |
RSpec::Matchers.define :be_the_same_time_as do |expected| | |
match do |actual| | |
expected.to_i == actual.to_i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment