From e97200405ec83ee9575cd01e53cd3c4872f05016 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 8 Nov 2015 21:04:17 -0800 Subject: [PATCH] renames the monitor creation helper --- .../test/file_evented_update_checker_test.rb | 2 +- activesupport/test/file_update_checker_test.rb | 2 +- ...pdate_checker_with_enumerable_test_cases.rb | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/activesupport/test/file_evented_update_checker_test.rb b/activesupport/test/file_evented_update_checker_test.rb index 72cf9bd387..bfaee8fb55 100644 --- a/activesupport/test/file_evented_update_checker_test.rb +++ b/activesupport/test/file_evented_update_checker_test.rb @@ -5,7 +5,7 @@ require 'file_update_checker_with_enumerable_test_cases' class FileEventedUpdateCheckerTest < ActiveSupport::TestCase include FileUpdateCheckerWithEnumerableTestCases - def build_new_watcher(files=[], dirs={}, &block) + def new_checker(files=[], dirs={}, &block) ActiveSupport::FileEventedUpdateChecker.new(files, dirs, &block) end diff --git a/activesupport/test/file_update_checker_test.rb b/activesupport/test/file_update_checker_test.rb index 9c7198caa3..de6b51823e 100644 --- a/activesupport/test/file_update_checker_test.rb +++ b/activesupport/test/file_update_checker_test.rb @@ -4,7 +4,7 @@ require 'file_update_checker_with_enumerable_test_cases' class FileUpdateCheckerTest < ActiveSupport::TestCase include FileUpdateCheckerWithEnumerableTestCases - def build_new_watcher(files=[], dirs={}, &block) + def new_checker(files=[], dirs={}, &block) ActiveSupport::FileUpdateChecker.new(files, dirs, &block) end end 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 e9c54880ce..fe19e617fa 100644 --- a/activesupport/test/file_update_checker_with_enumerable_test_cases.rb +++ b/activesupport/test/file_update_checker_with_enumerable_test_cases.rb @@ -21,7 +21,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_not_execute_the_block_if_no_paths_are_given i = 0 - checker = build_new_watcher { i += 1 } + checker = new_checker { i += 1 } assert !checker.execute_if_updated assert_equal 0, i @@ -30,7 +30,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_not_invoke_the_block_if_no_file_has_changed i = 0 - checker = build_new_watcher(@files) { i += 1 } + checker = new_checker(@files) { i += 1 } assert !checker.execute_if_updated assert_equal 0, i @@ -39,7 +39,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_invoke_the_block_if_a_file_has_changed i = 0 - checker = build_new_watcher(@files) { i += 1 } + checker = new_checker(@files) { i += 1 } sleep 1 touch(@files) @@ -52,7 +52,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_updated_should_become_true_when_watched_files_are_deleted i = 0 - watcher = build_new_watcher(@files) { i += 1 } + watcher = new_checker(@files) { i += 1 } assert !watcher.updated? rm_f(@files) @@ -64,7 +64,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_be_robust_enough_to_handle_deleted_files i = 0 - checker = build_new_watcher(@files) { i += 1 } + checker = new_checker(@files) { i += 1 } rm_f(@files) wait @@ -80,7 +80,7 @@ module FileUpdateCheckerWithEnumerableTestCases time = Time.mktime(now.year + 1, now.month, now.day) # wrong mtime from the future File.utime(time, time, @files[0]) - checker = build_new_watcher(@files) { i += 1 } + checker = new_checker(@files) { i += 1 } sleep 1 touch(@files[1..-1]) @@ -93,7 +93,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_cache_updated_result_until_execute i = 0 - checker = build_new_watcher(@files) { i += 1 } + checker = new_checker(@files) { i += 1 } assert !checker.updated? sleep 1 @@ -108,7 +108,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_invoke_the_block_if_a_watched_dir_changes i = 0 - checker = build_new_watcher([], @tmpdir => :rb) { i += 1 } + checker = new_checker([], @tmpdir => :rb) { i += 1 } sleep 1 touch(@files) @@ -121,7 +121,7 @@ module FileUpdateCheckerWithEnumerableTestCases def test_should_not_invoke_the_block_if_a_watched_dir_does_not_change i = 0 - checker = build_new_watcher([], @tmpdir => :txt) { i += 1 } + checker = new_checker([], @tmpdir => :txt) { i += 1 } touch(@files) wait