travisjeffery / timecop

A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
MIT License
3.37k stars 225 forks source link

0.9.2 seemingly breaks Date.strptime just when being required #271

Closed beyondcompute closed 3 years ago

beyondcompute commented 4 years ago

Hello.

Here are the steps to reproduce:

$ rails c
[1] pry(main)> Date.strptime('2019-07', '%Y-%m')
=> Mon, 01 Jul 2019
[2] pry(main)> require 'timecop'
=> true
[3] pry(main)> Date.strptime('2019-07', '%Y-%m')
=> Tue, 09 Jul 2019

Date.strptime_without_mock_date returns what is expected.

beyondcompute commented 4 years ago

I see that https://github.com/travisjeffery/timecop/pull/266 probably fixes that.

joshuacronemeyer commented 3 years ago

closed by https://github.com/travisjeffery/timecop/pull/266