aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
commit6aa7e04e06423e7d92ede727489ea346e88f7108 (patch)
tree9bdec92fd17898b662235bc0a491de827990130c /test/test_helper.rb
parentc59817e300dbe1aab3120cad603cdb14b14ed78b (diff)
parentdddfa903d2b856146f05ffb4415c31d6127bb5bf (diff)
Update upstream source from tag 'upstream/2.8.0'
Update to upstream version '2.8.0' with Debian dir 569f5866fbcf4e449c6c48dc5d20a3ab54f95252
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 96af546..9b761af 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -154,3 +154,16 @@ def skip_jruby_incompatible_test
msg = "This test uses a feature incompatible with JRuby"
skip(msg) if defined?(JRUBY_VERSION)
end
+
+def with_timezone(new_tz)
+ if new_tz
+ begin
+ prev_tz, ENV['TZ'] = ENV['TZ'], new_tz
+ yield
+ ensure
+ ENV['TZ'] = prev_tz
+ end
+ else
+ yield
+ end
+end