diff options
author | Xavier Noria <fxn@hashref.com> | 2015-11-10 00:59:46 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-11-10 01:34:27 -0800 |
commit | 9fa366a318625ee54bd96052b1c9d79dbcf959c7 (patch) | |
tree | c89bdd9c8763b1f56ae6c2f9aa1a6894502af09c /activesupport/test | |
parent | 3cd4775211bba820cdb5803ef0200040a2254f84 (diff) | |
download | rails-9fa366a318625ee54bd96052b1c9d79dbcf959c7.tar.gz rails-9fa366a318625ee54bd96052b1c9d79dbcf959c7.tar.bz2 rails-9fa366a318625ee54bd96052b1c9d79dbcf959c7.zip |
adds another test case in the monitors suite
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/file_update_checker_with_enumerable_test_cases.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/activesupport/test/file_update_checker_with_enumerable_test_cases.rb b/activesupport/test/file_update_checker_with_enumerable_test_cases.rb index 0aa1aaa727..e00ba893da 100644 --- a/activesupport/test/file_update_checker_with_enumerable_test_cases.rb +++ b/activesupport/test/file_update_checker_with_enumerable_test_cases.rb @@ -93,7 +93,7 @@ module FileUpdateCheckerWithEnumerableTestCases assert !checker.updated? end - def test_should_execute_the_block_if_files_change_in_a_watched_directory + def test_should_execute_the_block_if_files_change_in_a_watched_directory_one_extension i = 0 checker = new_checker([], @tmpdir => :rb) { i += 1 } @@ -104,6 +104,22 @@ module FileUpdateCheckerWithEnumerableTestCases assert_equal 1, i end + def test_should_execute_the_block_if_files_change_in_a_watched_directory_several_extensions + i = 0 + + checker = new_checker([], @tmpdir => [:rb, :txt]) { i += 1 } + + touch("#{@tmpdir}/foo.rb") + + assert checker.execute_if_updated + assert_equal 1, i + + touch("#{@tmpdir}/foo.rb") + + assert checker.execute_if_updated + assert_equal 2, i + end + def test_should_not_execute_the_block_if_the_file_extension_is_not_watched i = 0 |