aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/testing/time_helpers.rb7
-rw-r--r--guides/source/4_1_release_notes.md5
2 files changed, 7 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/testing/time_helpers.rb b/activesupport/lib/active_support/testing/time_helpers.rb
index 4c6bca5ada..9e0a3d6345 100644
--- a/activesupport/lib/active_support/testing/time_helpers.rb
+++ b/activesupport/lib/active_support/testing/time_helpers.rb
@@ -41,7 +41,7 @@ module ActiveSupport
# Containing helpers that helps you test passage of time.
module TimeHelpers
- # Change current time to the time in the future or in the past by a given time difference by
+ # Changes current time to the time in the future or in the past by a given time difference by
# stubbing +Time.now+ and +Date.today+.
#
# Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
@@ -61,7 +61,7 @@ module ActiveSupport
travel_to Time.now + duration, &block
end
- # Change current time to the given time by stubbing +Time.now+ and +Date.today+ to return the
+ # Changes current time to the given time by stubbing +Time.now+ and +Date.today+ to return the
# time or date passed into this method.
#
# Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
@@ -87,7 +87,8 @@ module ActiveSupport
end
end
- # Return the current time back to its original state.
+ # Returns the current time back to its original state, by removing the stubs added by
+ # `travel` and `travel_to`.
#
# Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
# travel_to Time.new(2004, 11, 24, 01, 04, 44)
diff --git a/guides/source/4_1_release_notes.md b/guides/source/4_1_release_notes.md
index 3668ffe44c..4e75bf400c 100644
--- a/guides/source/4_1_release_notes.md
+++ b/guides/source/4_1_release_notes.md
@@ -607,8 +607,9 @@ for detailed changes.
`Time.now` and
`Date.today`. ([Pull Request](https://github.com/rails/rails/pull/12824))
-* Added `ActiveSupport::Testing::TimeHelpers#travel_back`. This method return
- the current time to the original state. ([Pull Request](https://github.com/rails/rails/pull/13884))
+* Added `ActiveSupport::Testing::TimeHelpers#travel_back`. This method returns
+ the current time to the original state, by removing the stubs added by `travel`
+ and `travel_to`. ([Pull Request](https://github.com/rails/rails/pull/13884))
* Added `Numeric#in_milliseconds`, like `1.hour.in_milliseconds`, so we can feed
them to JavaScript functions like