diff options
author | John Hawthorn <john@hawthorn.email> | 2019-03-15 13:19:23 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-03-15 13:29:14 -0700 |
commit | dbfe5c6ac4431c50293183f4561150e6c2ce43ad (patch) | |
tree | 92aeeef627dddae7b17a7f2f8e9df97c9f3d9465 /activesupport/test | |
parent | 1cdc6c6576afe9a9fa67a6b313080a7dc62188d9 (diff) | |
download | rails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.tar.gz rails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.tar.bz2 rails-dbfe5c6ac4431c50293183f4561150e6c2ce43ad.zip |
Match evented checker behavior on dir with no exts
When FileUpdateChecker is passed a directory and given an empty array of
extensions to match on, it will match any extension.
Previously, EventedFileUpdateChecker would never match any files when
given an empty array. This commit makes it EventedFileUpdateChecker
match FileUpdateChecker, and watch all extensions when given an empty
array.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/file_update_checker_shared_tests.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/file_update_checker_shared_tests.rb b/activesupport/test/file_update_checker_shared_tests.rb index 72683816b3..84d89fa0a7 100644 --- a/activesupport/test/file_update_checker_shared_tests.rb +++ b/activesupport/test/file_update_checker_shared_tests.rb @@ -186,6 +186,18 @@ module FileUpdateCheckerSharedTests assert_equal 1, i end + test "should execute the block if files change in a watched directory any extensions" do + i = 0 + + checker = new_checker([], tmpdir => []) { i += 1 } + + touch(tmpfile("foo.rb")) + wait + + assert checker.execute_if_updated + assert_equal 1, i + end + test "should execute the block if files change in a watched directory several extensions" do i = 0 |