Welcome to mirror list, hosted at ThFree Co, Russian Federation.

be_like_time.rb « matchers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f27390eab7569c338f4269161f7c4d07872a967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
RSpec::Matchers.define :be_like_time do |expected|
  match do |actual|
    expect(actual).to be_within(1.second).of(expected)
  end

  description do
    "within one second of #{expected}"
  end

  failure_message do |actual|
    "expected #{actual} to be within one second of #{expected}"
  end
end