diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb index 687d80584..ac2e55c12 100644 --- a/lib/rake/file_utils_ext.rb +++ b/lib/rake/file_utils_ext.rb @@ -60,7 +60,7 @@ def verbose(value=nil) FileUtilsExt.verbose_flag = oldvalue end end - FileUtilsExt.verbose_flag + FileUtilsExt.verbose_flag != DEFAULT && FileUtilsExt.verbose_flag end # Get/set the nowrite flag controlling output from the FileUtils diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 3af5e96f1..829f61cae 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -105,6 +105,8 @@ def test_safe_ln_fails_on_script_error end def test_verbose + RakeFileUtils.verbose_flag = Rake::FileUtilsExt::DEFAULT + assert_equal false, verbose verbose true assert_equal true, verbose verbose false