Skip to content

Commit

Permalink
Always convert time .to_i before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
geeosh committed Apr 26, 2018
1 parent 1213531 commit dcc6d03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/sidekiq/matchers/have_enqueued_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def matches?(option, value)

def at_evaluator(value)
return false if job['at'].to_s.empty?
value.to_time.to_s == Time.at(job['at']).to_s
value.to_time.to_i == Time.at(job['at']).to_i
end

def in_evaluator(value)
return false if job['at'].to_s.empty?
(Time.now + value).to_s == Time.at(job['at']).to_s
(Time.now + value).to_i == Time.at(job['at']).to_i
end
end

Expand Down

0 comments on commit dcc6d03

Please sign in to comment.