Skip to content

Commit 4d90535

Browse files
committed
Update time zone spec context to attach via metadata
1 parent 747b9b8 commit 4d90535

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

spec/spec_helper.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,11 @@ def Object.const_missing(sym)
4848
end
4949
end
5050

51-
config.around :each do |example|
52-
if zone = example.metadata[:system_time_zone]
53-
orig_zone = ENV['TZ']
54-
ENV['TZ'] = zone
55-
example.run
56-
ENV['TZ'] = orig_zone
57-
else
58-
example.run
59-
end
51+
config.around :each, system_time_zone: true do |example|
52+
orig_zone = ENV['TZ']
53+
ENV['TZ'] = example.metadata[:system_time_zone]
54+
example.run
55+
ENV['TZ'] = orig_zone
6056
end
6157

6258
config.around :each, locale: true do |example|

0 commit comments

Comments
 (0)