aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/time_zone_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-30 04:19:00 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-30 04:19:00 -0800
commitdb6f69fd2a35dde23ab8a9b8fad6071043ac8954 (patch)
treec36d39f66c220c8041ddd72efff3264275adf4b5 /activesupport/test/time_zone_test.rb
parent7f5466d58299db35a3d320e0b526001ae3be11a7 (diff)
parentfa1f20e6549f962112948f5b3c27d09ab5e5faaf (diff)
downloadrails-db6f69fd2a35dde23ab8a9b8fad6071043ac8954.tar.gz
rails-db6f69fd2a35dde23ab8a9b8fad6071043ac8954.tar.bz2
rails-db6f69fd2a35dde23ab8a9b8fad6071043ac8954.zip
Merge pull request #13884 from rafaelfranca/rm-travel-back
Add `travel_back` to remove stubs from `travel` and `travel_to` and remove auto-rollback after each test case
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r--activesupport/test/time_zone_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 1107b48460..cd79efbe8c 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -97,6 +97,7 @@ class TimeZoneTest < ActiveSupport::TestCase
assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
travel_to(Time.utc(2000, 1, 2, 5)) # midnight Jan 2 EST
assert_equal Date.new(2000, 1, 2), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
+ travel_back
end
def test_tomorrow
@@ -108,6 +109,7 @@ class TimeZoneTest < ActiveSupport::TestCase
assert_equal Date.new(2000, 1, 2), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].tomorrow
travel_to(Time.utc(2000, 1, 2, 5)) # midnight Jan 2 EST
assert_equal Date.new(2000, 1, 3), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].tomorrow
+ travel_back
end
def test_yesterday
@@ -119,6 +121,7 @@ class TimeZoneTest < ActiveSupport::TestCase
assert_equal Date.new(1999, 12, 31), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].yesterday
travel_to(Time.utc(2000, 1, 2, 5)) # midnight Jan 2 EST
assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].yesterday
+ travel_back
end
def test_local