From 9c492885d178b1a3d0de2f710a8a276db3d867b2 Mon Sep 17 00:00:00 2001 From: Zuhao Wan Date: Wed, 18 Jun 2014 19:46:04 +0800 Subject: Extract out with_env_tz helper method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s used at so many places that extracting it out into a helper file is worth doing. --- activesupport/test/core_ext/numeric_ext_test.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'activesupport/test/core_ext/numeric_ext_test.rb') diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb index dbc3ffd319..b82448458d 100644 --- a/activesupport/test/core_ext/numeric_ext_test.rb +++ b/activesupport/test/core_ext/numeric_ext_test.rb @@ -71,14 +71,6 @@ class NumericExtTimeAndDateTimeTest < ActiveSupport::TestCase assert_equal Time.utc(2005,2,28,15,15,10), Time.utc(2004,2,29,15,15,10) + 1.year assert_equal DateTime.civil(2005,2,28,15,15,10), DateTime.civil(2004,2,29,15,15,10) + 1.year end - - protected - def with_env_tz(new_tz = 'US/Eastern') - old_tz, ENV['TZ'] = ENV['TZ'], new_tz - yield - ensure - old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ') - end end class NumericExtDateTest < ActiveSupport::TestCase -- cgit v1.2.3