mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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:
parent
72e48024f0
commit
cb2a09e65e
@ -18,6 +18,6 @@ describe Checksum do
|
|||||||
|
|
||||||
it { is_expected.to eq(other) }
|
it { is_expected.to eq(other) }
|
||||||
it { is_expected.not_to eq(other_reversed) }
|
it { is_expected.not_to eq(other_reversed) }
|
||||||
it { is_expected.not_to be(nil) }
|
it { is_expected.not_to be_nil }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -719,7 +719,7 @@ describe Formula do
|
|||||||
url "https://brew.sh/test-1.0.tbz"
|
url "https://brew.sh/test-1.0.tbz"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(f.service).to be(nil)
|
expect(f.service).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "service complicated" do
|
specify "service complicated" do
|
||||||
@ -735,7 +735,7 @@ describe Formula do
|
|||||||
working_dir var
|
working_dir var
|
||||||
keep_alive true
|
keep_alive true
|
||||||
end
|
end
|
||||||
expect(f.service).not_to be(nil)
|
expect(f.service).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "service uses simple run" do
|
specify "service uses simple run" do
|
||||||
@ -746,7 +746,7 @@ describe Formula do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(f.service).not_to be(nil)
|
expect(f.service).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "service helpers return data" do
|
specify "service helpers return data" do
|
||||||
|
@ -142,10 +142,10 @@ describe Homebrew::Livecheck do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns nil when not given a string or valid symbol" do
|
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, 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(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, 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(:invalid_symbol, c_livecheck_url)).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -458,11 +458,11 @@ describe Homebrew::Livecheck::SkipConditions do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns an empty hash for a non-skippable formula" do
|
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
|
end
|
||||||
|
|
||||||
it "returns an empty hash for a non-skippable cask" do
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ describe Formula do
|
|||||||
|
|
||||||
expect(f.class.stable.deps[0].name).to eq("hello_both")
|
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[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
|
end
|
||||||
|
|
||||||
it "adds a patch on Linux only" do
|
it "adds a patch on Linux only" do
|
||||||
|
@ -59,7 +59,7 @@ describe Formula do
|
|||||||
|
|
||||||
expect(f.class.stable.deps[0].name).to eq("hello_both")
|
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[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
|
end
|
||||||
|
|
||||||
it "adds a patch on Mac only" do
|
it "adds a patch on Mac only" do
|
||||||
|
@ -7,7 +7,7 @@ describe Utils do
|
|||||||
shared_examples "git_repository helper function" do |method_name|
|
shared_examples "git_repository helper function" do |method_name|
|
||||||
context "when directory is not a Git repository" do
|
context "when directory is not a Git repository" do
|
||||||
it "returns nil if `safe` parameter is `false`" 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
|
end
|
||||||
|
|
||||||
it "raises an error if `safe` parameter is `true`" do
|
it "raises an error if `safe` parameter is `true`" do
|
||||||
@ -22,7 +22,7 @@ describe Utils do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns nil if `safe` parameter is `false`" do
|
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
|
end
|
||||||
|
|
||||||
it "raises an error if `safe` parameter is `true`" do
|
it "raises an error if `safe` parameter is `true`" do
|
||||||
|
@ -142,7 +142,7 @@ describe Utils::Git do
|
|||||||
describe "::path" do
|
describe "::path" do
|
||||||
it "returns nil when git is not available" do
|
it "returns nil when git is not available" do
|
||||||
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
|
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
|
||||||
expect(described_class.path).to be(nil)
|
expect(described_class.path).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns path of git when git is available" do
|
it "returns path of git when git is available" do
|
||||||
@ -153,7 +153,7 @@ describe Utils::Git do
|
|||||||
describe "::version" do
|
describe "::version" do
|
||||||
it "returns nil when git is not available" do
|
it "returns nil when git is not available" do
|
||||||
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
|
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
|
||||||
expect(described_class.version).to be(nil)
|
expect(described_class.version).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns version of git when git is available" do
|
it "returns version of git when git is available" do
|
||||||
|
@ -174,11 +174,11 @@ describe PyPI do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns nil for invalid versions" do
|
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
|
end
|
||||||
|
|
||||||
it "returns nil for non-pypi urls" do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,11 +6,11 @@ require "utils/spdx"
|
|||||||
describe SPDX do
|
describe SPDX do
|
||||||
describe ".license_data" do
|
describe ".license_data" do
|
||||||
it "has the license list version" 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
|
end
|
||||||
|
|
||||||
it "has the release date" do
|
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
|
end
|
||||||
|
|
||||||
it "has licenses" do
|
it "has licenses" do
|
||||||
@ -20,11 +20,11 @@ describe SPDX do
|
|||||||
|
|
||||||
describe ".exception_data" do
|
describe ".exception_data" do
|
||||||
it "has the license list version" 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
|
end
|
||||||
|
|
||||||
it "has the release date" do
|
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
|
end
|
||||||
|
|
||||||
it "has exceptions" do
|
it "has exceptions" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user