Skip to content

Commit 0c927f8

Browse files
authored
Merge pull request #141 from bitberry-dev/master
Fix flaky time calculation test by explicitly setting timezone
2 parents 9a2969f + acbbfd6 commit 0c927f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

spec/lib/dotiw_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
include DOTIW::Methods
1414
end
1515

16-
START_TIME = '01-08-2009'.to_time
16+
START_TIME = '01-08-2009'.to_time(:utc)
1717

1818
before do
1919
I18n.locale = :en
20+
ActiveSupport.to_time_preserves_timezone = :zone
21+
2022
allow(Time).to receive(:now).and_return(START_TIME)
2123
allow(Time.zone).to receive(:now).and_return(START_TIME)
2224
end

0 commit comments

Comments
 (0)