Improve documentation [ci skip]

上级 7abb6e00
......@@ -41,7 +41,7 @@ def unstub_object(stub)
# 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 @@ def travel(duration, &block)
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 @@ def travel_to(date_or_time, &block)
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)
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册