1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec/support/matchers/be_about_now.rb
Oliver Peate eb6bccb3e3 Avoid time travel in tests
By being a little bit less strict in our assertions, we can still
prove the behaviour is correct, without having to freeze / travel time.
2019-08-01 11:21:06 +01:00

5 lines
126 B
Ruby

RSpec::Matchers.define :be_about_now do
match do |actual|
expect(actual).to be_within(2.seconds).of(Time.now)
end
end