diff options
author | T.J. Schuck <tj@getharvest.com> | 2017-04-18 12:28:34 -0400 |
---|---|---|
committer | T.J. Schuck <tj@getharvest.com> | 2017-04-18 15:43:01 -0400 |
commit | 1d82b7ce7c96b86e8ef44b2eba12bccd2bd14331 (patch) | |
tree | 8adfd170bc654ba3e4a7b6e3108f76849a618bb0 /activerecord/test/cases/readonly_test.rb | |
parent | 8776a7139757d0b264785c774d4e7f37d4bc1ac7 (diff) | |
download | rails-1d82b7ce7c96b86e8ef44b2eba12bccd2bd14331.tar.gz rails-1d82b7ce7c96b86e8ef44b2eba12bccd2bd14331.tar.bz2 rails-1d82b7ce7c96b86e8ef44b2eba12bccd2bd14331.zip |
Explicitly require AS::Time in AS::Testing::TimeHelpers
If you just try to use `ActiveSupport::Testing::TimeHelpers` standalone by requiring `active_support/testing/time_helpers`, you currently get an error: `NoMethodError: undefined method `change' for 2017-12-14 01:04:44 -0500:Time`
9f6e82ee4783e491c20f5244a613fdeb4024beb5 added a dependency on `AS::Time` by using `AS::Time#change`.
Here's a script to reproduce the error:
```ruby
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activesupport", github: "rails/rails"
end
require "active_support/testing/time_helpers"
require "minitest/autorun"
class BugTest < Minitest::Test
include ActiveSupport::Testing::TimeHelpers
def test_stuff
travel_to Time.new(2017, 12, 14, 01, 04, 44) do
assert true
end
end
end
```
It currently fails for all 5.x.x versions and master. Ideally, this would be backported to `5-0-stable` and `5-1-stable` as well.
Diffstat (limited to 'activerecord/test/cases/readonly_test.rb')
0 files changed, 0 insertions, 0 deletions