Skip to content

Commit 24fea90

Browse files
authored
Merge pull request #20763 from Homebrew/dug/raise-warnings
Enable raise_on_warning in specs
2 parents b352fff + 7879b20 commit 24fea90

File tree

10 files changed

+13
-12
lines changed

10 files changed

+13
-12
lines changed

Library/Homebrew/test/cache_store_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
describe "#write_if_dirty!" do
9393
context "with an open database" do
9494
it "does not raise an error when `close` is called on the database" do
95-
expect { sample_db.write_if_dirty! }.not_to raise_error(NoMethodError)
95+
expect { sample_db.write_if_dirty! }.not_to raise_error
9696
end
9797
end
9898

@@ -102,7 +102,7 @@
102102
end
103103

104104
it "does not raise an error when `close` is called on the database" do
105-
expect { sample_db.write_if_dirty! }.not_to raise_error(NoMethodError)
105+
expect { sample_db.write_if_dirty! }.not_to raise_error
106106
end
107107
end
108108
end

Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
end.to raise_error(UnsupportedInstallationMethod)
4747
end
4848

49-
it "does not raise an error when given a file URL" do
49+
it "does not raise an error when given a file URL", :needs_utils_curl do
5050
loader = described_class.new("file://#{TEST_FIXTURE_DIR}/cask/Casks/local-caffeine.rb")
5151
expect do
5252
loader.load(config: nil)
53-
end.not_to raise_error(UnsupportedInstallationMethod)
53+
end.not_to raise_error
5454
end
5555
end
5656
end

Library/Homebrew/test/cmd/shared_examples/reinstall_pkgconf_if_needed_spec.rb renamed to Library/Homebrew/test/cmd/shared_examples/reinstall_pkgconf_if_needed.rb

File renamed without changes.

Library/Homebrew/test/cmd/update-report_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require "formula_versions"
55
require "yaml"
66
require "cmd/shared_examples/args_parse"
7-
require "cmd/shared_examples/reinstall_pkgconf_if_needed_spec"
7+
require "cmd/shared_examples/reinstall_pkgconf_if_needed"
88

99
RSpec.describe Homebrew::Cmd::UpdateReport do
1010
it_behaves_like "parseable arguments"

Library/Homebrew/test/cmd/upgrade_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "cmd/shared_examples/args_parse"
44
require "cmd/upgrade"
5-
require "cmd/shared_examples/reinstall_pkgconf_if_needed_spec"
5+
require "cmd/shared_examples/reinstall_pkgconf_if_needed"
66

77
RSpec.describe Homebrew::Cmd::UpgradeCmd do
88
include FileUtils

Library/Homebrew/test/formulary_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,10 @@ def formula_json_contents(extra_items = {})
603603
end.to raise_error(UnsupportedInstallationMethod)
604604
end
605605

606-
it "does not raise an error when given a file URL" do
606+
it "does not raise an error when given a file URL", :needs_utils_curl do
607607
expect do
608608
described_class.factory("file://#{TEST_FIXTURE_DIR}/testball.rb")
609-
end.not_to raise_error(UnsupportedInstallationMethod)
609+
end.not_to raise_error
610610
end
611611
end
612612

Library/Homebrew/test/github_runner_matrix_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
RSpec.describe GitHubRunnerMatrix, :no_api do
77
before do
8+
allow(ENV).to receive(:fetch).and_call_original
89
allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_RUNNER").and_return("ubuntu-latest")
910
allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_LONG_TIMEOUT", "false").and_return("false")
1011
allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_BUILD_ON_GITHUB_RUNNER", "false").and_return("false")

Library/Homebrew/test/sandbox_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def initialize(*, **)
111111
mktmpdir do |path|
112112
FileUtils.touch path/"foo"
113113
sandbox.allow_write_path(path)
114-
expect { sandbox.run "chmod", "ug-w", path/"foo" }.not_to raise_error(ErrorDuringExecution)
114+
expect { sandbox.run "chmod", "ug-w", path/"foo" }.not_to raise_error
115115
end
116116
end
117117
end
@@ -125,7 +125,7 @@ def initialize(*, **)
125125
mktmpdir do |path|
126126
FileUtils.touch path/"foo"
127127
sandbox.allow_write_path(path)
128-
expect { sandbox.run "chmod", "4000", path/"foo" }.not_to raise_error(ErrorDuringExecution)
128+
expect { sandbox.run "chmod", "4000", path/"foo" }.not_to raise_error
129129
end
130130
end
131131
end

Library/Homebrew/test/services/cli_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
it "checks the input exists" do
5454
expect do
5555
services_cli.check!("hello")
56-
end.not_to raise_error(UsageError,
57-
"Invalid usage: Formula(e) missing, please provide a formula name or use `--all`.")
56+
end.not_to raise_error
5857
end
5958
end
6059

Library/Homebrew/test/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676

7777
config.raise_errors_for_deprecations!
7878
config.warnings = true
79+
config.raise_on_warning = true
7980
config.disable_monkey_patching!
8081

8182
config.filter_run_when_matching :focus

0 commit comments

Comments
 (0)