Skip to content

Commit

Permalink
reproduce issue when Timecop mocks the Process.clock_gettime
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturT committed Jun 19, 2024
1 parent 745ce96 commit 96f53c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/support/config/timecop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://github.com/travisjeffery/timecop

Timecop.mock_process_clock = true
7 changes: 7 additions & 0 deletions spec/timecop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
let(:time_1) { Time.local(2015, 12, 1) }
let(:time_2) { Time.local(2016, 1, 21) }

before do
Timecop.travel(time_1)
end
after do
#Timecop.return
end

it 'travel in time' do
sleep 1
Timecop.travel(time_1)
Expand Down

0 comments on commit 96f53c2

Please sign in to comment.