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

build(deps-dev): bump rubocop-rspec from 2.26.1 to 2.27.0 in /Library/Homebrew #16788

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ GEM
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.26.1)
rubocop-rspec (2.27.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def mock_curl_download(stdout:)
end

describe "::tap_from_source_download" do
let(:api_cache_root) { Homebrew::API::HOMEBREW_CACHE_API_SOURCE }
let(:api_cache_root) { described_class::HOMEBREW_CACHE_API_SOURCE }
let(:cache_path) do
api_cache_root/"Homebrew"/"homebrew-core"/"cf5c386c1fa2cb54279d78c0990dd7a0fa4bc327"/"Formula"/"foo.rb"
end
Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/test/cask/cask_loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@

it "warns when using the short token" do
expect do
expect(described_class.for("version-newest")).to be_a Cask::CaskLoader::FromPathLoader
expect(described_class.for("version-newest")).to be_a described_class::FromPathLoader
end.to output(/version-newest was renamed to version-latest/).to_stderr
end

it "warns when using the full token" do
expect do
expect(described_class.for("homebrew/cask/version-newest")).to be_a Cask::CaskLoader::FromPathLoader
expect(described_class.for("homebrew/cask/version-newest")).to be_a described_class::FromPathLoader
end.to output(/version-newest was renamed to version-latest/).to_stderr
end
end
Expand All @@ -55,13 +55,13 @@

it "warns when using the short token" do
expect do
expect(described_class.for("version-newest")).to be_a Cask::CaskLoader::FromAPILoader
expect(described_class.for("version-newest")).to be_a described_class::FromAPILoader
end.to output(/version-newest was renamed to version-latest/).to_stderr
end

it "warns when using the full token" do
expect do
expect(described_class.for("homebrew/cask/version-newest")).to be_a Cask::CaskLoader::FromAPILoader
expect(described_class.for("homebrew/cask/version-newest")).to be_a described_class::FromAPILoader
end.to output(/version-newest was renamed to version-latest/).to_stderr
end
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cmd/update-report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def perform_update(fixture_name = "")

expect do
described_class.new(tap)
end.to raise_error(Reporter::ReporterRevisionUnsetError)
end.to raise_error(described_class::ReporterRevisionUnsetError)
end

specify "without any changes" do
Expand Down
24 changes: 13 additions & 11 deletions Library/Homebrew/test/dev-cmd/bottle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def install
new_catalina_sha256 = "ec6d7f08412468f28dee2be17ad8cd8b883b16b34329efcecce019b8c9736428"
new_hash = { "tags" => { "catalina" => { "sha256" => new_catalina_sha256 } } }
expected_checksum_hash = { mojave: "7571772bf7a0c9fe193e70e521318b53993bee6f351976c9b6e01e00d13d6c3f" }
expected_checksum_hash[:cellar] = Homebrew::DEFAULT_MACOS_CELLAR
expected_checksum_hash[:cellar] = described_class::DEFAULT_MACOS_CELLAR
expect(homebrew.merge_bottle_spec([:sha256], old_spec, new_hash)).to eq [
["sha256 catalina: old: #{old_catalina_sha256.inspect}, new: #{new_catalina_sha256.inspect}"],
[expected_checksum_hash],
Expand All @@ -480,11 +480,12 @@ def install
end

it "generates a string with default cellar path" do
expect(homebrew.generate_sha256_line(:catalina, "deadbeef", Homebrew::DEFAULT_LINUX_CELLAR, 0, 10)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
expect(homebrew.generate_sha256_line(:catalina, "deadbeef", described_class::DEFAULT_LINUX_CELLAR, 0,
10)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
end

it "generates a string with non-default cellar path" do
Expand Down Expand Up @@ -513,11 +514,12 @@ def install
end

it "generates a string with default cellar path" do
expect(homebrew.generate_sha256_line(:catalina, "deadbeef", Homebrew::DEFAULT_LINUX_CELLAR, 14, 30)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
expect(homebrew.generate_sha256_line(:catalina, "deadbeef", described_class::DEFAULT_LINUX_CELLAR, 14,
30)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
end

it "generates a string with non-default cellar path" do
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/download_strategies/abstract_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
let(:specs) { { bottle: true } }

it "extends Pourable" do
expect(strategy).to be_a(AbstractDownloadStrategy::Pourable)
expect(strategy).to be_a(described_class::Pourable)
end
end

context "without specs[:bottle]" do
it "is does not extend Pourable" do
expect(strategy).not_to be_a(AbstractDownloadStrategy::Pourable)
expect(strategy).not_to be_a(described_class::Pourable)
end
end
end
4 changes: 2 additions & 2 deletions Library/Homebrew/test/formulary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,14 @@ def formula_json_contents(extra_items = {})
mktmpdir.cd do
FileUtils.mkdir "Formula"
FileUtils.touch "Formula/gcc.rb"
expect(described_class.loader_for("./Formula/gcc.rb")).to be_a Formulary::FromPathLoader
expect(described_class.loader_for("./Formula/gcc.rb")).to be_a described_class::FromPathLoader
end
end
end

context "when given a tapped name" do
it "returns a `FromTapLoader`" do
expect(described_class.loader_for("homebrew/core/gcc")).to be_a Formulary::FromTapLoader
expect(described_class.loader_for("homebrew/core/gcc")).to be_a described_class::FromTapLoader
end
end

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/test/keg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def setup_test_keg(name, version)
it "fails when already linked" do
keg.link

expect { keg.link }.to raise_error(Keg::AlreadyLinkedError)
expect { keg.link }.to raise_error(described_class::AlreadyLinkedError)
end

it "fails when files exist" do
touch dst

expect { keg.link }.to raise_error(Keg::ConflictError)
expect { keg.link }.to raise_error(described_class::ConflictError)
end

it "ignores broken symlinks at target" do
Expand Down Expand Up @@ -263,7 +263,7 @@ def setup_test_keg(name, version)

lib = HOMEBREW_PREFIX/"lib"
expect(lib.children.length).to eq(2)
expect { b.link }.to raise_error(Keg::ConflictError)
expect { b.link }.to raise_error(described_class::ConflictError)
expect(lib.children.length).to eq(2)
end

Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def create_appcast_xml(items_str = "")

let(:items) do
{
v124: Homebrew::Livecheck::Strategy::Sparkle::Item.new(
v124: described_class::Item.new(
title: item_hashes[:v124][:title],
release_notes_link: item_hashes[:v124][:release_notes_link],
pub_date: Time.parse(item_hashes[:v124][:pub_date]),
Expand All @@ -199,7 +199,7 @@ def create_appcast_xml(items_str = "")
),
minimum_system_version: MacOSVersion.new(item_hashes[:v124][:minimum_system_version]),
),
v123: Homebrew::Livecheck::Strategy::Sparkle::Item.new(
v123: described_class::Item.new(
title: item_hashes[:v123][:title],
release_notes_link: item_hashes[:v123][:release_notes_link],
pub_date: Time.parse(item_hashes[:v123][:pub_date]),
Expand All @@ -210,7 +210,7 @@ def create_appcast_xml(items_str = "")
),
minimum_system_version: MacOSVersion.new(item_hashes[:v123][:minimum_system_version]),
),
v122: Homebrew::Livecheck::Strategy::Sparkle::Item.new(
v122: described_class::Item.new(
title: item_hashes[:v122][:title],
link: item_hashes[:v122][:link],
release_notes_link: item_hashes[:v122][:release_notes_link],
Expand All @@ -224,7 +224,7 @@ def create_appcast_xml(items_str = "")
),
minimum_system_version: MacOSVersion.new(item_hashes[:v122][:minimum_system_version]),
),
v121: Homebrew::Livecheck::Strategy::Sparkle::Item.new(
v121: described_class::Item.new(
title: item_hashes[:v121][:title],
release_notes_link: item_hashes[:v121][:release_notes_link],
pub_date: Time.parse(item_hashes[:v121][:pub_date]),
Expand All @@ -236,7 +236,7 @@ def create_appcast_xml(items_str = "")
),
minimum_system_version: MacOSVersion.new(item_hashes[:v121][:minimum_system_version]),
),
v120: Homebrew::Livecheck::Strategy::Sparkle::Item.new(
v120: described_class::Item.new(
title: item_hashes[:v120][:title],
release_notes_link: item_hashes[:v120][:release_notes_link],
pub_date: Time.parse(item_hashes[:v120][:pub_date]),
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/test/livecheck/strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

describe "::from_symbol" do
it "returns the Strategy module represented by the Symbol argument" do
expect(strategy.from_symbol(:page_match)).to eq(Homebrew::Livecheck::Strategy::PageMatch)
expect(strategy.from_symbol(:page_match)).to eq(described_class::PageMatch)
end
end

Expand All @@ -16,15 +16,15 @@

context "when no regex is provided" do
it "returns an array of usable strategies which doesn't include PageMatch" do
expect(strategy.from_url(url)).to eq([Homebrew::Livecheck::Strategy::Sourceforge])
expect(strategy.from_url(url)).to eq([described_class::Sourceforge])
end
end

context "when a regex is provided" do
it "returns an array of usable strategies including PageMatch, sorted in descending order by priority" do
expect(strategy.from_url(url, regex_provided: true))
.to eq(
[Homebrew::Livecheck::Strategy::Sourceforge, Homebrew::Livecheck::Strategy::PageMatch],
[described_class::Sourceforge, described_class::PageMatch],
)
end
end
Expand Down
26 changes: 13 additions & 13 deletions Library/Homebrew/test/locale_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

describe "raises a ParserError when given" do
it "an empty string" do
expect { described_class.parse("") }.to raise_error(Locale::ParserError)
expect { described_class.parse("") }.to raise_error(described_class::ParserError)
end

it "a string in a wrong format" do
expect { described_class.parse("zh-CN-Hans") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh_CN_Hans") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zhCNHans") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh-CN_Hans") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zhCN") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh_Hans") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh-") }.to raise_error(Locale::ParserError)
expect { described_class.parse("ZH-CN") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh-cn") }.to raise_error(Locale::ParserError)
expect { described_class.parse("zh-CN-Hans") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zh_CN_Hans") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zhCNHans") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zh-CN_Hans") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zhCN") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zh_Hans") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zh-") }.to raise_error(described_class::ParserError)
expect { described_class.parse("ZH-CN") }.to raise_error(described_class::ParserError)
expect { described_class.parse("zh-cn") }.to raise_error(described_class::ParserError)
end
end
end
Expand All @@ -40,9 +40,9 @@
end

it "raises a ParserError when one of the arguments does not match the locale format" do
expect { described_class.new("ZH", nil, nil) }.to raise_error(Locale::ParserError)
expect { described_class.new(nil, "hans", nil) }.to raise_error(Locale::ParserError)
expect { described_class.new(nil, nil, "cn") }.to raise_error(Locale::ParserError)
expect { described_class.new("ZH", nil, nil) }.to raise_error(described_class::ParserError)
expect { described_class.new(nil, "hans", nil) }.to raise_error(described_class::ParserError)
expect { described_class.new(nil, nil, "cn") }.to raise_error(described_class::ParserError)
end
end

Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/macos_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
it "raises an error if the version is not a valid macOS version" do
expect do
described_class.new("1.2")
end.to raise_error(MacOSVersion::Error, 'unknown or unsupported macOS version: "1.2"')
end.to raise_error(described_class::Error, 'unknown or unsupported macOS version: "1.2"')
end

it "creates a new version from a valid macOS version" do
Expand All @@ -66,7 +66,7 @@
it "raises an error if the symbol is not a valid macOS version" do
expect do
described_class.from_symbol(:foo)
end.to raise_error(MacOSVersion::Error, "unknown or unsupported macOS version: :foo")
end.to raise_error(described_class::Error, "unknown or unsupported macOS version: :foo")
end

it "creates a new version from a valid macOS version" do
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/migrator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
it "raises an error if there is no old path" do
expect do
described_class.new(new_formula, "oldname")
end.to raise_error(Migrator::MigratorNoOldpathError)
end.to raise_error(described_class::MigratorNoOldpathError)
end

it "raises an error if the Taps differ" do
Expand All @@ -71,7 +71,7 @@

expect do
described_class.new(new_formula, "oldname")
end.to raise_error(Migrator::MigratorDifferentTapsError)
end.to raise_error(described_class::MigratorDifferentTapsError)
end
end

Expand Down
22 changes: 12 additions & 10 deletions Library/Homebrew/test/os/mac_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,38 @@

describe "::sdk_path_if_needed" do
it "calls sdk_path on Xcode-only systems" do
allow(OS::Mac::Xcode).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:installed?).and_return(false)
allow(described_class::Xcode).to receive(:installed?).and_return(true)
allow(described_class::CLT).to receive(:installed?).and_return(false)
expect(described_class).to receive(:sdk_path)
described_class.sdk_path_if_needed
end

it "does not call sdk_path on Xcode-and-CLT systems with system headers" do
allow(OS::Mac::Xcode).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive_messages(installed?: true, separate_header_package?: false)
allow(described_class::Xcode).to receive(:installed?).and_return(true)
allow(described_class::CLT).to receive_messages(installed?: true, separate_header_package?: false)
expect(described_class).not_to receive(:sdk_path)
described_class.sdk_path_if_needed
end

it "does not call sdk_path on CLT-only systems with no CLT SDK" do
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive_messages(installed?: true, provides_sdk?: false)
allow(described_class::Xcode).to receive(:installed?).and_return(false)
allow(described_class::CLT).to receive_messages(installed?: true, provides_sdk?: false)
expect(described_class).not_to receive(:sdk_path)
described_class.sdk_path_if_needed
end

it "does not call sdk_path on CLT-only systems with a CLT SDK if the system provides headers" do
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive_messages(installed?: true, provides_sdk?: true, separate_header_package?: false)
allow(described_class::Xcode).to receive(:installed?).and_return(false)
allow(described_class::CLT).to receive_messages(installed?: true, provides_sdk?: true,
separate_header_package?: false)
expect(described_class).not_to receive(:sdk_path)
described_class.sdk_path_if_needed
end

it "calls sdk_path on CLT-only systems with a CLT SDK if the system does not provide headers" do
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive_messages(installed?: true, provides_sdk?: true, separate_header_package?: true)
allow(described_class::Xcode).to receive(:installed?).and_return(false)
allow(described_class::CLT).to receive_messages(installed?: true, provides_sdk?: true,
separate_header_package?: true)
expect(described_class).to receive(:sdk_path)
described_class.sdk_path_if_needed
end
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/system_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@

it 'does not format `stderr` when it starts with \r' do
expect do
Class.new.extend(SystemCommand::Mixin).system_command \
Class.new.extend(described_class::Mixin).system_command \
"bash",
args: [
"-c",
Expand All @@ -310,7 +310,7 @@
end

it "does not interpret the executable as a shell line" do
expect(Class.new.extend(SystemCommand::Mixin).system_command(executable)).to be_a_success
expect(Class.new.extend(described_class::Mixin).system_command(executable)).to be_a_success
end
end

Expand Down