Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rake.verbose to return true/false even if unset #567

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rake/file_utils_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/test_rake_file_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def test_safe_ln_fails_on_script_error
end

def test_verbose
RakeFileUtils.verbose_flag = Rake::FileUtilsExt::DEFAULT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary? In my understanding, your change is for without above line.

assert_equal false, verbose
verbose true
assert_equal true, verbose
verbose false
Expand Down