Fix (auto-correct) more RSpec/BeNil offenses

- The `RSpec/BeEq` auto-corrections made more `RSpec/BeNil` offenses, so another go of `brew style --only=RSpec/BeNil --fix\` is needed.
This commit is contained in:
Issy Long 2022-03-01 00:36:05 +00:00
parent 72e48024f0
commit cb2a09e65e
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
10 changed files with 22 additions and 22 deletions

View File

@ -18,6 +18,6 @@ describe Checksum do
it { is_expected.to eq(other) }
it { is_expected.not_to eq(other_reversed) }
it { is_expected.not_to be(nil) }
it { is_expected.not_to be_nil }
end
end

View File

@ -719,7 +719,7 @@ describe Formula do
url "https://brew.sh/test-1.0.tbz"
end
expect(f.service).to be(nil)
expect(f.service).to be_nil
end
specify "service complicated" do
@ -735,7 +735,7 @@ describe Formula do
working_dir var
keep_alive true
end
expect(f.service).not_to be(nil)
expect(f.service).not_to be_nil
end
specify "service uses simple run" do
@ -746,7 +746,7 @@ describe Formula do
end
end
expect(f.service).not_to be(nil)
expect(f.service).not_to be_nil
end
specify "service helpers return data" do

View File

@ -142,10 +142,10 @@ describe Homebrew::Livecheck do
end
it "returns nil when not given a string or valid symbol" do
expect(livecheck.livecheck_url_to_string(nil, f_livecheck_url)).to be(nil)
expect(livecheck.livecheck_url_to_string(nil, c_livecheck_url)).to be(nil)
expect(livecheck.livecheck_url_to_string(:invalid_symbol, f_livecheck_url)).to be(nil)
expect(livecheck.livecheck_url_to_string(:invalid_symbol, c_livecheck_url)).to be(nil)
expect(livecheck.livecheck_url_to_string(nil, f_livecheck_url)).to be_nil
expect(livecheck.livecheck_url_to_string(nil, c_livecheck_url)).to be_nil
expect(livecheck.livecheck_url_to_string(:invalid_symbol, f_livecheck_url)).to be_nil
expect(livecheck.livecheck_url_to_string(:invalid_symbol, c_livecheck_url)).to be_nil
end
end

View File

@ -458,11 +458,11 @@ describe Homebrew::Livecheck::SkipConditions do
end
it "returns an empty hash for a non-skippable formula" do
expect(skip_conditions.referenced_skip_information(formulae[:basic], original_name)).to be(nil)
expect(skip_conditions.referenced_skip_information(formulae[:basic], original_name)).to be_nil
end
it "returns an empty hash for a non-skippable cask" do
expect(skip_conditions.referenced_skip_information(casks[:basic], original_name)).to be(nil)
expect(skip_conditions.referenced_skip_information(casks[:basic], original_name)).to be_nil
end
end

View File

@ -54,7 +54,7 @@ describe Formula do
expect(f.class.stable.deps[0].name).to eq("hello_both")
expect(f.class.stable.deps[1].name).to eq("hello_linux")
expect(f.class.stable.deps[2]).to be(nil)
expect(f.class.stable.deps[2]).to be_nil
end
it "adds a patch on Linux only" do

View File

@ -59,7 +59,7 @@ describe Formula do
expect(f.class.stable.deps[0].name).to eq("hello_both")
expect(f.class.stable.deps[1].name).to eq("hello_macos")
expect(f.class.stable.deps[2]).to be(nil)
expect(f.class.stable.deps[2]).to be_nil
end
it "adds a patch on Mac only" do

View File

@ -7,7 +7,7 @@ describe Utils do
shared_examples "git_repository helper function" do |method_name|
context "when directory is not a Git repository" do
it "returns nil if `safe` parameter is `false`" do
expect(described_class.public_send(method_name, TEST_TMPDIR, safe: false)).to be(nil)
expect(described_class.public_send(method_name, TEST_TMPDIR, safe: false)).to be_nil
end
it "raises an error if `safe` parameter is `true`" do
@ -22,7 +22,7 @@ describe Utils do
end
it "returns nil if `safe` parameter is `false`" do
expect(described_class.public_send(method_name, HOMEBREW_CACHE, safe: false)).to be(nil)
expect(described_class.public_send(method_name, HOMEBREW_CACHE, safe: false)).to be_nil
end
it "raises an error if `safe` parameter is `true`" do

View File

@ -142,7 +142,7 @@ describe Utils::Git do
describe "::path" do
it "returns nil when git is not available" do
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
expect(described_class.path).to be(nil)
expect(described_class.path).to be_nil
end
it "returns path of git when git is available" do
@ -153,7 +153,7 @@ describe Utils::Git do
describe "::version" do
it "returns nil when git is not available" do
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
expect(described_class.version).to be(nil)
expect(described_class.version).to be_nil
end
it "returns version of git when git is available" do

View File

@ -174,11 +174,11 @@ describe PyPI do
end
it "returns nil for invalid versions" do
expect(described_class.update_pypi_url(old_package_url, "0.0.0")).to be nil
expect(described_class.update_pypi_url(old_package_url, "0.0.0")).to be_nil
end
it "returns nil for non-pypi urls" do
expect(described_class.update_pypi_url("https://brew.sh/foo-1.0.tgz", "1.1")).to be nil
expect(described_class.update_pypi_url("https://brew.sh/foo-1.0.tgz", "1.1")).to be_nil
end
end
end

View File

@ -6,11 +6,11 @@ require "utils/spdx"
describe SPDX do
describe ".license_data" do
it "has the license list version" do
expect(described_class.license_data["licenseListVersion"]).not_to be(nil)
expect(described_class.license_data["licenseListVersion"]).not_to be_nil
end
it "has the release date" do
expect(described_class.license_data["releaseDate"]).not_to be(nil)
expect(described_class.license_data["releaseDate"]).not_to be_nil
end
it "has licenses" do
@ -20,11 +20,11 @@ describe SPDX do
describe ".exception_data" do
it "has the license list version" do
expect(described_class.exception_data["licenseListVersion"]).not_to be(nil)
expect(described_class.exception_data["licenseListVersion"]).not_to be_nil
end
it "has the release date" do
expect(described_class.exception_data["releaseDate"]).not_to be(nil)
expect(described_class.exception_data["releaseDate"]).not_to be_nil
end
it "has exceptions" do