diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-02-01 08:37:28 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-02-01 08:43:39 +0900 |
commit | 725058fc0959df333a5c802193cd9d7305facdbf (patch) | |
tree | d01358cafafa327ca0d5b469466efc59369457df /activesupport/test | |
parent | 773e45a59163415e8bc247ebee1663c7e8113c81 (diff) | |
download | rails-725058fc0959df333a5c802193cd9d7305facdbf.tar.gz rails-725058fc0959df333a5c802193cd9d7305facdbf.tar.bz2 rails-725058fc0959df333a5c802193cd9d7305facdbf.zip |
explicitly require `listen` in `EventedFileUpdateCheckerTest`
Currently, executing the `test_initialize_raises_an_ArgumentError_if_no_block_given`
test alone will result in an error.
```
$ ./bin/test test/evented_file_update_checker_test.rb -n test_initialize_raises_an_ArgumentError_if_no_block_given
Run options: -n test_initialize_raises_an_ArgumentError_if_no_block_given --seed 6692
# Running:
E
Error:
EventedFileUpdateCheckerTest#test_initialize_raises_an_ArgumentError_if_no_block_given:
NameError: uninitialized constant EventedFileUpdateCheckerTest::Listen
rails/activesupport/test/evented_file_update_checker_test.rb:21:in `teardown'
```
This is because if do not specify a file or directory for
`EventedFileUpdateChecker`, do not require `listen`, and using listen
method in teardown.
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/evented_file_update_checker.rb#L53..L65
Therefore, added listen's require to avoid errors.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/evented_file_update_checker_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/evented_file_update_checker_test.rb b/activesupport/test/evented_file_update_checker_test.rb index bb2ae4baa6..afdbc99f08 100644 --- a/activesupport/test/evented_file_update_checker_test.rb +++ b/activesupport/test/evented_file_update_checker_test.rb @@ -7,6 +7,7 @@ class EventedFileUpdateCheckerTest < ActiveSupport::TestCase def setup skip if ENV["LISTEN"] == "0" + require "listen" super end |