From 2b8b3a5cb6b31e973adb995729bd780b9528af7c Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 24 Jan 2023 20:30:29 -0800 Subject: [PATCH] Enable RSpec/NoExpectationExample --- Library/.rubocop_rspec.yml | 2 -- Library/Homebrew/test/formula_installer_bottle_spec.rb | 3 +++ Library/Homebrew/test/keg_spec.rb | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/.rubocop_rspec.yml b/Library/.rubocop_rspec.yml index 93911071f0..34fb6943b9 100644 --- a/Library/.rubocop_rspec.yml +++ b/Library/.rubocop_rspec.yml @@ -15,8 +15,6 @@ RSpec/MessageSpies: Enabled: false RSpec/StubbedMock: Enabled: false -RSpec/NoExpectationExample: - Enabled: false # TODO: try to reduce these RSpec/ExampleLength: diff --git a/Library/Homebrew/test/formula_installer_bottle_spec.rb b/Library/Homebrew/test/formula_installer_bottle_spec.rb index f2daedb5ff..0926b154d5 100644 --- a/Library/Homebrew/test/formula_installer_bottle_spec.rb +++ b/Library/Homebrew/test/formula_installer_bottle_spec.rb @@ -67,6 +67,8 @@ describe FormulaInstaller do expect(f.libexec).to be_a_directory end + # This test wraps expect() calls in `test_basic_formula_setup` + # rubocop:disable RSpec/NoExpectationExample specify "basic bottle install" do allow(DevelopmentTools).to receive(:installed?).and_return(false) Homebrew.install_args.parse(["testball_bottle"]) @@ -74,6 +76,7 @@ describe FormulaInstaller do test_basic_formula_setup(f) end end + # rubocop:enable RSpec/NoExpectationExample specify "basic bottle install with cellar information on sha256 line" do allow(DevelopmentTools).to receive(:installed?).and_return(false) diff --git a/Library/Homebrew/test/keg_spec.rb b/Library/Homebrew/test/keg_spec.rb index cbc99ef0b7..55faf1cb6e 100644 --- a/Library/Homebrew/test/keg_spec.rb +++ b/Library/Homebrew/test/keg_spec.rb @@ -268,6 +268,8 @@ describe Keg do expect(lib.children.length).to eq(2) end + # This is a legacy violation that would benefit from a clear expectation. + # rubocop:disable RSpec/NoExpectationExample it "removes broken symlinks that conflict with directories" do a = HOMEBREW_CELLAR/"a"/"1.0" (a/"lib"/"foo").mkpath @@ -280,6 +282,7 @@ describe Keg do keg.link end + # rubocop:enable RSpec/NoExpectationExample end describe "#optlink" do