diff --git a/CHANGELOG.md b/CHANGELOG.md index e70f83f6..529eb58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * [CHANGE] Fix test warning related to `cucumber_opts` declaration (by [@faisal][]) * [BUGFIX] Stop using long-deprecated MiniTest module name, removed in 5.19.0 (by [@faisal][]) +* [CHANGE] Disable VERBOSE warnings in test stubs (by [@fbuys][]) # v4.8.1 / 2023-05-17 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.8.0...v4.8.1) diff --git a/test/fakefs_helper.rb b/test/fakefs_helper.rb index ff25faeb..69cb3250 100644 --- a/test/fakefs_helper.rb +++ b/test/fakefs_helper.rb @@ -5,9 +5,13 @@ module FakeFS class File < StringIO + # $VERBOSE = nil to suppress warnings when we overrie flock. + original_verbose = $VERBOSE + $VERBOSE = nil def flock(*) true end + $VERBOSE = original_verbose end end diff --git a/test/lib/rubycritic/commands/compare_test.rb b/test/lib/rubycritic/commands/compare_test.rb index db3d8e66..ab52e643 100644 --- a/test/lib/rubycritic/commands/compare_test.rb +++ b/test/lib/rubycritic/commands/compare_test.rb @@ -9,9 +9,13 @@ module RubyCritic module SourceControlSystem class Git < Base + # $VERBOSE = nil to suppress warnings when we overrie self.current_branch. + original_verbose = $VERBOSE + $VERBOSE = nil def self.current_branch 'feature_branch' end + $VERBOSE = original_verbose end end