diff --git a/Library/Homebrew/test/ENV_spec.rb b/Library/Homebrew/test/ENV_spec.rb index 1f0632b12b..c09a50bca6 100644 --- a/Library/Homebrew/test/ENV_spec.rb +++ b/Library/Homebrew/test/ENV_spec.rb @@ -11,7 +11,7 @@ describe "ENV" do it "supports switching compilers" do subject.clang - expect(subject["LD"]).to be nil + expect(subject["LD"]).to be_nil expect(subject["CC"]).to eq(subject["OBJC"]) end @@ -23,7 +23,7 @@ describe "ENV" do subject["foo"] = "bar" end - expect(subject["foo"]).to be nil + expect(subject["foo"]).to be_nil expect(subject).to eq(before) end @@ -37,7 +37,7 @@ describe "ENV" do end }.to raise_error(StandardError) - expect(subject["foo"]).to be nil + expect(subject["foo"]).to be_nil expect(subject).to eq(before) end @@ -139,7 +139,7 @@ describe "ENV" do subject["MAKEFLAGS"] = "-j4" subject.deparallelize do - expect(subject["MAKEFLAGS"]).to be nil + expect(subject["MAKEFLAGS"]).to be_nil end expect(subject["MAKEFLAGS"]).to eq("-j4") diff --git a/Library/Homebrew/test/PATH_spec.rb b/Library/Homebrew/test/PATH_spec.rb index 68357d4b85..efd7fdfc88 100644 --- a/Library/Homebrew/test/PATH_spec.rb +++ b/Library/Homebrew/test/PATH_spec.rb @@ -125,7 +125,7 @@ describe PATH do end it "returns nil instead of an empty #{described_class}" do - expect(described_class.new.existing).to be nil + expect(described_class.new.existing).to be_nil end end end diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index 97e6caf5c0..f8f3c0ecf7 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -342,7 +342,7 @@ describe Cask::DSL, :cask do let(:token) { "with-depends-on-formula" } it "allows depends_on formula to be specified" do - expect(cask.depends_on.formula).not_to be nil + expect(cask.depends_on.formula).not_to be_nil end end @@ -350,7 +350,7 @@ describe Cask::DSL, :cask do let(:token) { "with-depends-on-formula-multiple" } it "allows multiple depends_on formula to be specified" do - expect(cask.depends_on.formula).not_to be nil + expect(cask.depends_on.formula).not_to be_nil end end end @@ -360,7 +360,7 @@ describe Cask::DSL, :cask do let(:token) { "with-depends-on-cask" } it "is allowed" do - expect(cask.depends_on.cask).not_to be nil + expect(cask.depends_on.cask).not_to be_nil end end @@ -368,7 +368,7 @@ describe Cask::DSL, :cask do let(:token) { "with-depends-on-cask-multiple" } it "is allowed" do - expect(cask.depends_on.cask).not_to be nil + expect(cask.depends_on.cask).not_to be_nil end end end @@ -396,7 +396,7 @@ describe Cask::DSL, :cask do let(:token) { "with-depends-on-arch" } it "is allowed to be specified" do - expect(cask.depends_on.arch).not_to be nil + expect(cask.depends_on.arch).not_to be_nil end end diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index 69eea85296..54dc168d65 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -41,7 +41,7 @@ describe Homebrew::CLI::Parser do it "does not set the positive name if the positive flag is not passed" do args = parser.parse([]) - expect(args.positive?).to be nil + expect(args.positive?).to be_nil end end diff --git a/Library/Homebrew/test/commands_spec.rb b/Library/Homebrew/test/commands_spec.rb index d817a4c80a..be8f748a6a 100644 --- a/Library/Homebrew/test/commands_spec.rb +++ b/Library/Homebrew/test/commands_spec.rb @@ -70,7 +70,7 @@ describe Commands do specify "returns the path for an internal command" do expect(described_class.path("rbcmd")).to eq(HOMEBREW_LIBRARY_PATH/"cmd/rbcmd.rb") expect(described_class.path("shcmd")).to eq(HOMEBREW_LIBRARY_PATH/"cmd/shcmd.sh") - expect(described_class.path("idontexist1234")).to be nil + expect(described_class.path("idontexist1234")).to be_nil end specify "returns the path for an internal developer-command" do diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb index bff6a44f41..a12c3c6127 100644 --- a/Library/Homebrew/test/dependency_collector_spec.rb +++ b/Library/Homebrew/test/dependency_collector_spec.rb @@ -65,7 +65,7 @@ describe DependencyCollector do it "creates a resource dependency from a '.gz' URL" do resource = Resource.new resource.url("https://brew.sh/foo.tar.gz") - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end it "creates a resource dependency from a '.lz' URL" do diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index d0f27dfe20..ecf0803ffd 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -46,7 +46,7 @@ module Homebrew expect(ft).to have_trailing_newline expect(ft =~ /\burl\b/).to be_truthy - expect(ft.line_number(/desc/)).to be nil + expect(ft.line_number(/desc/)).to be_nil expect(ft.line_number(/\burl\b/)).to eq(2) expect(ft).to include("Valid") end diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 2863a9604c..17b34b0398 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -68,7 +68,7 @@ describe Homebrew::Diagnostic::Checks do ENV["PATH"] = ENV["PATH"].gsub \ %r{(?:^|#{File::PATH_SEPARATOR})#{HOMEBREW_PREFIX}/bin}o, "" - expect(checks.check_user_path_1).to be nil + expect(checks.check_user_path_1).to be_nil expect(checks.check_user_path_2) .to match("Homebrew's \"bin\" was not found in your PATH.") end @@ -80,8 +80,8 @@ describe Homebrew::Diagnostic::Checks do ENV["HOMEBREW_PATH"].gsub(/(?:^|#{Regexp.escape(File::PATH_SEPARATOR)})#{Regexp.escape(sbin)}/, "") (sbin/"something").mkpath - expect(checks.check_user_path_1).to be nil - expect(checks.check_user_path_2).to be nil + expect(checks.check_user_path_1).to be_nil + expect(checks.check_user_path_2).to be_nil expect(checks.check_user_path_3) .to match("Homebrew's \"sbin\" was not found in your PATH") ensure diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index dfa8e9b6bc..054efd2db1 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -47,12 +47,12 @@ describe "Exception" do describe "#dependent_s" do it "returns nil if there is no dependent" do - expect(error.dependent_s).to be nil + expect(error.dependent_s).to be_nil end it "returns nil if it depended on by itself" do error.dependent = "foo" - expect(error.dependent_s).to be nil + expect(error.dependent_s).to be_nil end it "returns a string if there is a dependent" do diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 8f31f76d62..a705af58a8 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -38,9 +38,9 @@ describe Formula do expect(f.full_name).to eq(name) expect(f.full_specified_name).to eq(name) expect(f.path).to eq(path) - expect(f.alias_path).to be nil - expect(f.alias_name).to be nil - expect(f.full_alias_name).to be nil + expect(f.alias_path).to be_nil + expect(f.alias_name).to be_nil + expect(f.full_alias_name).to be_nil expect(f.specified_path).to eq(path) expect { klass.new }.to raise_error(ArgumentError) end @@ -70,9 +70,9 @@ describe Formula do expect(f.full_name).to eq(full_name) expect(f.full_specified_name).to eq(full_name) expect(f.path).to eq(path) - expect(f.alias_path).to be nil - expect(f.alias_name).to be nil - expect(f.full_alias_name).to be nil + expect(f.alias_path).to be_nil + expect(f.alias_name).to be_nil + expect(f.full_alias_name).to be_nil expect(f.specified_path).to eq(path) expect { klass.new }.to raise_error(ArgumentError) end @@ -175,9 +175,9 @@ describe Formula do ] build_values_with_no_installed_alias.each do |build| f.build = build - expect(f.installed_alias_path).to be nil - expect(f.installed_alias_name).to be nil - expect(f.full_installed_alias_name).to be nil + expect(f.installed_alias_path).to be_nil + expect(f.installed_alias_name).to be_nil + expect(f.full_installed_alias_name).to be_nil expect(f.installed_specified_name).to eq(f.name) expect(f.full_installed_specified_name).to eq(f.name) end @@ -210,9 +210,9 @@ describe Formula do ] build_values_with_no_installed_alias.each do |build| f.build = build - expect(f.installed_alias_path).to be nil - expect(f.installed_alias_name).to be nil - expect(f.full_installed_alias_name).to be nil + expect(f.installed_alias_path).to be_nil + expect(f.installed_alias_name).to be_nil + expect(f.full_installed_alias_name).to be_nil expect(f.installed_specified_name).to eq(f.name) expect(f.full_installed_specified_name).to eq(f.full_name) end @@ -401,7 +401,7 @@ describe Formula do end specify "#<=>" do - expect(Testball.new <=> Object.new).to be nil + expect(Testball.new <=> Object.new).to be_nil end describe "#installed_alias_path" do @@ -414,7 +414,7 @@ describe Formula do f.build = BuildOptions.new(Options.new, f.options) expect(f.alias_path).to eq(alias_path) - expect(f.installed_alias_path).to be nil + expect(f.installed_alias_path).to be_nil end example "alias paths with tab with non alias source path" do @@ -427,7 +427,7 @@ describe Formula do f.build = Tab.new(source: { "path" => source_path.to_s }) expect(f.alias_path).to eq(alias_path) - expect(f.installed_alias_path).to be nil + expect(f.installed_alias_path).to be_nil end example "alias paths with tab with alias source path" do @@ -580,7 +580,7 @@ describe Formula do url "foo-1.0" end - expect(f.head).to be nil + expect(f.head).to be_nil end it "honors attributes declared before specs" do @@ -1132,7 +1132,7 @@ describe Formula do specify "alias changes when not installed with alias" do tab.source["path"] = Formulary.core_path(f.name).to_s - expect(f.current_installed_alias_target).to be nil + expect(f.current_installed_alias_target).to be_nil expect(f.latest_formula).to eq(f) expect(f).not_to have_changed_installed_alias_target expect(f).not_to supersede_an_installed_formula @@ -1526,7 +1526,7 @@ describe Formula do end it "returns nil when not installed" do - expect(f.any_installed_version).to be nil + expect(f.any_installed_version).to be_nil end it "returns package version when installed" do diff --git a/Library/Homebrew/test/formula_spec_selection_spec.rb b/Library/Homebrew/test/formula_spec_selection_spec.rb index c16c13ad5c..587d0d1ff6 100644 --- a/Library/Homebrew/test/formula_spec_selection_spec.rb +++ b/Library/Homebrew/test/formula_spec_selection_spec.rb @@ -40,7 +40,7 @@ describe Formula do head "foo" end - expect(f.stable).to be nil + expect(f.stable).to be_nil expect(f).to be_head end diff --git a/Library/Homebrew/test/installed_dependents_spec.rb b/Library/Homebrew/test/installed_dependents_spec.rb index 824c6f2d94..3843cff6bb 100644 --- a/Library/Homebrew/test/installed_dependents_spec.rb +++ b/Library/Homebrew/test/installed_dependents_spec.rb @@ -81,7 +81,7 @@ describe InstalledDependents do specify "no dependencies anywhere" do dependencies nil - expect(described_class.find_some_installed_dependents([keg])).to be nil + expect(described_class.find_some_installed_dependents([keg])).to be_nil end specify "missing Formula dependency" do @@ -93,7 +93,7 @@ describe InstalledDependents do specify "uninstalling dependent and dependency" do dependencies nil Formula["bar"].class.depends_on "foo" - expect(described_class.find_some_installed_dependents([keg, dependent])).to be nil + expect(described_class.find_some_installed_dependents([keg, dependent])).to be_nil end specify "renamed dependency" do @@ -112,7 +112,7 @@ describe InstalledDependents do specify "empty dependencies in Tab" do dependencies [] - expect(described_class.find_some_installed_dependents([keg])).to be nil + expect(described_class.find_some_installed_dependents([keg])).to be_nil end specify "same name but different version in Tab" do @@ -123,7 +123,7 @@ describe InstalledDependents do specify "different name and same version in Tab" do stub_formula_name("baz") dependencies [{ "full_name" => "baz", "version" => keg.version.to_s }] - expect(described_class.find_some_installed_dependents([keg])).to be nil + expect(described_class.find_some_installed_dependents([keg])).to be_nil end specify "same name and version in Tab" do @@ -140,7 +140,7 @@ describe InstalledDependents do specify "non-opt-linked" do keg.remove_opt_record dependencies [{ "full_name" => "foo", "version" => "1.0" }] - expect(described_class.find_some_installed_dependents([keg])).to be nil + expect(described_class.find_some_installed_dependents([keg])).to be_nil end specify "keg-only" do diff --git a/Library/Homebrew/test/keg_spec.rb b/Library/Homebrew/test/keg_spec.rb index 1b82ada38b..cbc99ef0b7 100644 --- a/Library/Homebrew/test/keg_spec.rb +++ b/Library/Homebrew/test/keg_spec.rb @@ -55,7 +55,7 @@ describe Keg do end specify "#oldname_opt_record" do - expect(keg.oldname_opt_record).to be nil + expect(keg.oldname_opt_record).to be_nil oldname_opt_record = HOMEBREW_PREFIX/"opt/oldfoo" oldname_opt_record.make_relative_symlink(HOMEBREW_CELLAR/"foo/1.0") expect(keg.oldname_opt_record).to eq(oldname_opt_record) diff --git a/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb b/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb index 63540ef2f1..87f94bb6ea 100644 --- a/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb @@ -68,7 +68,7 @@ describe Homebrew::Livecheck::Strategy::Sparkle do let(:item_from_appcast_xml) { sparkle.item_from_content(appcast_xml) } it "returns nil if content is blank" do - expect(sparkle.item_from_content("")).to be nil + expect(sparkle.item_from_content("")).to be_nil end it "returns an Item when given XML data" do diff --git a/Library/Homebrew/test/livecheck_spec.rb b/Library/Homebrew/test/livecheck_spec.rb index 7e4b0db27b..aa5afde716 100644 --- a/Library/Homebrew/test/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck_spec.rb @@ -30,7 +30,7 @@ describe Livecheck do describe "#formula" do it "returns nil if not set" do - expect(livecheckable_f.formula).to be nil + expect(livecheckable_f.formula).to be_nil end it "returns the String if set" do @@ -47,7 +47,7 @@ describe Livecheck do describe "#cask" do it "returns nil if not set" do - expect(livecheckable_c.cask).to be nil + expect(livecheckable_c.cask).to be_nil end it "returns the String if set" do @@ -64,7 +64,7 @@ describe Livecheck do describe "#regex" do it "returns nil if not set" do - expect(livecheckable_f.regex).to be nil + expect(livecheckable_f.regex).to be_nil end it "returns the Regexp if set" do @@ -83,7 +83,7 @@ describe Livecheck do it "sets @skip to true when no argument is provided" do expect(livecheckable_f.skip).to be true expect(livecheckable_f.instance_variable_get(:@skip)).to be true - expect(livecheckable_f.instance_variable_get(:@skip_msg)).to be nil + expect(livecheckable_f.instance_variable_get(:@skip_msg)).to be_nil end it "sets @skip to true and @skip_msg to the provided String" do @@ -110,7 +110,7 @@ describe Livecheck do describe "#strategy" do it "returns nil if not set" do - expect(livecheckable_f.strategy).to be nil + expect(livecheckable_f.strategy).to be_nil end it "returns the Symbol if set" do @@ -129,7 +129,7 @@ describe Livecheck do let(:url_string) { "https://brew.sh" } it "returns nil if not set" do - expect(livecheckable_f.url).to be nil + expect(livecheckable_f.url).to be_nil end it "returns a string when set to a string" do diff --git a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb index 02a6362dc7..8943f93ac4 100644 --- a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb @@ -35,19 +35,19 @@ describe DependencyCollector do it "does not create a resource dependency from a '.xz' URL" do resource.url("https://brew.sh/foo.xz") allow_any_instance_of(Object).to receive(:which).with("xz").and_return(Pathname.new("foo")) - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end it "does not create a resource dependency from a '.zip' URL" do resource.url("https://brew.sh/foo.zip") allow_any_instance_of(Object).to receive(:which).with("unzip").and_return(Pathname.new("foo")) - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end it "does not create a resource dependency from a '.bz2' URL" do resource.url("https://brew.sh/foo.tar.bz2") allow_any_instance_of(Object).to receive(:which).with("bzip2").and_return(Pathname.new("foo")) - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end end end diff --git a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb index cad682f1a1..9d6948de4c 100644 --- a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb @@ -11,34 +11,34 @@ describe DependencyCollector do specify "Resource dependency from a '.xz' URL" do resource = Resource.new resource.url("https://brew.sh/foo.tar.xz") - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end specify "Resource dependency from a '.zip' URL" do resource = Resource.new resource.url("https://brew.sh/foo.zip") - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end specify "Resource dependency from a '.bz2' URL" do resource = Resource.new resource.url("https://brew.sh/foo.tar.bz2") - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end specify "Resource dependency from a '.git' URL" do resource = Resource.new resource.url("git://brew.sh/foo/bar.git") - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil end specify "Resource dependency from a Subversion URL" do resource = Resource.new resource.url("svn://brew.sh/foo/bar") if MacOS.version < :catalina - expect(collector.add(resource)).to be nil + expect(collector.add(resource)).to be_nil else - expect(collector.add(resource)).not_to be nil + expect(collector.add(resource)).not_to be_nil end end end diff --git a/Library/Homebrew/test/pkg_version_spec.rb b/Library/Homebrew/test/pkg_version_spec.rb index 2ff51a01f4..517580c800 100644 --- a/Library/Homebrew/test/pkg_version_spec.rb +++ b/Library/Homebrew/test/pkg_version_spec.rb @@ -56,12 +56,12 @@ describe PkgVersion do describe "#<=>" do it "returns nil if the comparison fails" do - expect(described_class.new(Version.create("1.0"), 0) <=> Object.new).to be nil - expect(Object.new <=> described_class.new(Version.create("1.0"), 0)).to be nil - expect(Object.new <=> described_class.new(Version.create("1.0"), 0)).to be nil - expect(described_class.new(Version.create("1.0"), 0) <=> nil).to be nil + expect(described_class.new(Version.create("1.0"), 0) <=> Object.new).to be_nil + expect(Object.new <=> described_class.new(Version.create("1.0"), 0)).to be_nil + expect(Object.new <=> described_class.new(Version.create("1.0"), 0)).to be_nil + expect(described_class.new(Version.create("1.0"), 0) <=> nil).to be_nil # This one used to fail due to dereferencing a null `self` - expect(described_class.new(nil, 0) <=> described_class.new(Version.create("1.0"), 0)).to be nil + expect(described_class.new(nil, 0) <=> described_class.new(Version.create("1.0"), 0)).to be_nil end end diff --git a/Library/Homebrew/test/requirement_spec.rb b/Library/Homebrew/test/requirement_spec.rb index 4fe5cad5a1..0cd1c0db19 100644 --- a/Library/Homebrew/test/requirement_spec.rb +++ b/Library/Homebrew/test/requirement_spec.rb @@ -180,7 +180,7 @@ describe Requirement do let(:klass) { Class.new(described_class) } it "returns nil" do - expect(requirement.modify_build_environment).to be nil + expect(requirement.modify_build_environment).to be_nil end end end diff --git a/Library/Homebrew/test/resource_spec.rb b/Library/Homebrew/test/resource_spec.rb index 29513698e0..63a14b0b1e 100644 --- a/Library/Homebrew/test/resource_spec.rb +++ b/Library/Homebrew/test/resource_spec.rb @@ -85,7 +85,7 @@ describe Resource do end it "returns nil if unset" do - expect(resource.version).to be nil + expect(resource.version).to be_nil end end @@ -103,7 +103,7 @@ describe Resource do describe "#checksum" do it "returns nil if unset" do - expect(resource.checksum).to be nil + expect(resource.checksum).to be_nil end it "returns the checksum set with #sha256" do diff --git a/Library/Homebrew/test/software_spec/head_spec.rb b/Library/Homebrew/test/software_spec/head_spec.rb index 89ee2ca6b9..0f92ba4be6 100644 --- a/Library/Homebrew/test/software_spec/head_spec.rb +++ b/Library/Homebrew/test/software_spec/head_spec.rb @@ -11,6 +11,6 @@ describe HeadSoftwareSpec do end specify "#verify_download_integrity" do - expect(head_spec.verify_download_integrity(Object.new)).to be nil + expect(head_spec.verify_download_integrity(Object.new)).to be_nil end end diff --git a/Library/Homebrew/test/system_command_result_spec.rb b/Library/Homebrew/test/system_command_result_spec.rb index a4995c8b13..fd82a100bf 100644 --- a/Library/Homebrew/test/system_command_result_spec.rb +++ b/Library/Homebrew/test/system_command_result_spec.rb @@ -170,7 +170,7 @@ describe SystemCommand::Result do let(:stdout) { "" } it "returns nil" do - expect(result_plist).to be nil + expect(result_plist).to be_nil end end end diff --git a/Library/Homebrew/test/tab_spec.rb b/Library/Homebrew/test/tab_spec.rb index 24b64daf5a..85b6ec12d0 100644 --- a/Library/Homebrew/test/tab_spec.rb +++ b/Library/Homebrew/test/tab_spec.rb @@ -64,20 +64,20 @@ describe Tab do expect(tab.homebrew_version).to eq(HOMEBREW_VERSION) expect(tab.unused_options).to be_empty expect(tab.used_options).to be_empty - expect(tab.changed_files).to be nil + expect(tab.changed_files).to be_nil expect(tab).not_to be_built_as_bottle expect(tab).not_to be_poured_from_bottle expect(tab).to be_stable expect(tab).not_to be_head - expect(tab.tap).to be nil - expect(tab.time).to be nil - expect(tab.HEAD).to be nil - expect(tab.runtime_dependencies).to be nil - expect(tab.stable_version).to be nil - expect(tab.head_version).to be nil + expect(tab.tap).to be_nil + expect(tab.time).to be_nil + expect(tab.HEAD).to be_nil + expect(tab.runtime_dependencies).to be_nil + expect(tab.stable_version).to be_nil + expect(tab.head_version).to be_nil expect(tab.cxxstdlib.compiler).to eq(DevelopmentTools.default_compiler) - expect(tab.cxxstdlib.type).to be nil - expect(tab.source["path"]).to be nil + expect(tab.cxxstdlib.type).to be_nil + expect(tab.source["path"]).to be_nil end specify "#include?" do @@ -114,25 +114,25 @@ describe Tab do specify "#runtime_dependencies" do tab = described_class.new - expect(tab.runtime_dependencies).to be nil + expect(tab.runtime_dependencies).to be_nil tab.homebrew_version = "1.1.6" - expect(tab.runtime_dependencies).to be nil + expect(tab.runtime_dependencies).to be_nil tab.runtime_dependencies = [] - expect(tab.runtime_dependencies).not_to be nil + expect(tab.runtime_dependencies).not_to be_nil tab.homebrew_version = "1.1.5" - expect(tab.runtime_dependencies).to be nil + expect(tab.runtime_dependencies).to be_nil tab.homebrew_version = "1.1.7" - expect(tab.runtime_dependencies).not_to be nil + expect(tab.runtime_dependencies).not_to be_nil tab.homebrew_version = "1.1.10" - expect(tab.runtime_dependencies).not_to be nil + expect(tab.runtime_dependencies).not_to be_nil tab.runtime_dependencies = [{ "full_name" => "foo", "version" => "1.0" }] - expect(tab.runtime_dependencies).not_to be nil + expect(tab.runtime_dependencies).not_to be_nil end specify "::runtime_deps_hash" do @@ -232,7 +232,7 @@ describe Tab do expect(tab.HEAD).to eq(TEST_SHA1) expect(tab.cxxstdlib.compiler).to eq(:clang) expect(tab.cxxstdlib.type).to eq(:libcxx) - expect(tab.runtime_dependencies).to be nil + expect(tab.runtime_dependencies).to be_nil end it "raises a parse exception message including the Tab filename" do @@ -331,7 +331,7 @@ describe Tab do f.prefix.mkpath tab = described_class.for_formula(f) - expect(tab.tabfile).to be nil + expect(tab.tabfile).to be_nil end it "can create a Tab for a Formula with multiple Kegs" do diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index ae7ef7a253..bde5abb829 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -156,7 +156,7 @@ describe Tap do expect(homebrew_foo_tap.issues_url).to eq("https://github.com/Homebrew/homebrew-foo/issues") (Tap::TAP_DIRECTORY/"someone/homebrew-no-git").mkpath - expect(described_class.new("someone", "no-git").issues_url).to be nil + expect(described_class.new("someone", "no-git").issues_url).to be_nil ensure path.parent.rmtree end @@ -198,13 +198,13 @@ describe Tap do end it "returns nil if the Tap is not a Git repository" do - expect(homebrew_foo_tap.remote).to be nil + expect(homebrew_foo_tap.remote).to be_nil end it "returns nil if Git is not available" do setup_git_repo allow(Utils::Git).to receive(:available?).and_return(false) - expect(homebrew_foo_tap.remote).to be nil + expect(homebrew_foo_tap.remote).to be_nil end end @@ -240,13 +240,13 @@ describe Tap do end it "returns nil if the Tap is not a Git repository" do - expect(homebrew_foo_tap.remote_repo).to be nil + expect(homebrew_foo_tap.remote_repo).to be_nil end it "returns nil if Git is not available" do setup_git_repo allow(Utils::Git).to receive(:available?).and_return(false) - expect(homebrew_foo_tap.remote_repo).to be nil + expect(homebrew_foo_tap.remote_repo).to be_nil end end @@ -450,11 +450,11 @@ describe Tap do specify "#config" do setup_git_repo - expect(homebrew_foo_tap.config["foo"]).to be nil + expect(homebrew_foo_tap.config["foo"]).to be_nil homebrew_foo_tap.config["foo"] = "bar" expect(homebrew_foo_tap.config["foo"]).to eq("bar") homebrew_foo_tap.config["foo"] = nil - expect(homebrew_foo_tap.config["foo"]).to be nil + expect(homebrew_foo_tap.config["foo"]).to be_nil end describe "#each" do diff --git a/Library/Homebrew/test/utils/bottles/collector_spec.rb b/Library/Homebrew/test/utils/bottles/collector_spec.rb index 696cabc76f..79a571fc4b 100644 --- a/Library/Homebrew/test/utils/bottles/collector_spec.rb +++ b/Library/Homebrew/test/utils/bottles/collector_spec.rb @@ -21,12 +21,12 @@ describe Utils::Bottles::Collector do end it "returns nil if empty" do - expect(collector.specification_for(Utils::Bottles::Tag.from_symbol(:foo))).to be nil + expect(collector.specification_for(Utils::Bottles::Tag.from_symbol(:foo))).to be_nil end it "returns nil when there is no match" do collector.add(catalina, checksum: Checksum.new("bar_checksum"), cellar: "bar_cellar") - expect(collector.specification_for(Utils::Bottles::Tag.from_symbol(:foo))).to be nil + expect(collector.specification_for(Utils::Bottles::Tag.from_symbol(:foo))).to be_nil end it "uses older tags when needed", :needs_macos do diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index 02f795bee3..d83372f85c 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -56,9 +56,9 @@ describe Utils::Shell do end it "returns nil when input is invalid" do - expect(described_class.from_path("")).to be nil - expect(described_class.from_path("@@@@@@")).to be nil - expect(described_class.from_path("invalid_shell-4.2")).to be nil + expect(described_class.from_path("")).to be_nil + expect(described_class.from_path("@@@@@@")).to be_nil + expect(described_class.from_path("invalid_shell-4.2")).to be_nil end end diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index f92d0bbcde..a729d9988d 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -132,7 +132,7 @@ describe "globally-scoped helper methods" do end it "skips non-executables" do - expect(which(File.basename(cmd), File.dirname(cmd))).to be nil + expect(which(File.basename(cmd), File.dirname(cmd))).to be_nil end it "skips malformed path and doesn't fail" do diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index c387836786..c7bff88004 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -35,13 +35,13 @@ describe Version do specify "comparison returns nil for non-token" do v = described_class.create("1") - expect(v <=> Object.new).to be nil + expect(v <=> Object.new).to be_nil expect { v > Object.new }.to raise_error(ArgumentError) end describe "#to_str" do it "implicitly converts token to string" do - expect(String.try_convert(described_class.new("foo"))).not_to be nil + expect(String.try_convert(described_class.new("foo"))).not_to be_nil end end end @@ -211,7 +211,7 @@ describe Version do specify "comparison returns nil for non-version" do v = described_class.create("1.0") - expect(v <=> Object.new).to be nil + expect(v <=> Object.new).to be_nil expect { v > Object.new }.to raise_error(ArgumentError) end @@ -271,7 +271,7 @@ describe Version do specify "HEAD without commit" do v = described_class.create("HEAD") - expect(v.commit).to be nil + expect(v.commit).to be_nil expect(v.to_str).to eq("HEAD") end end @@ -326,7 +326,7 @@ describe Version do describe "#minor" do it "returns minor version token" do - expect(described_class.create("1").minor).to be nil + expect(described_class.create("1").minor).to be_nil expect(described_class.create("1.2").minor).to be == Version::Token.create("2") expect(described_class.create("1.2.3").minor).to be == Version::Token.create("2") expect(described_class.create("1.2.3alpha").minor).to be == Version::Token.create("2") @@ -340,8 +340,8 @@ describe Version do describe "#patch" do it "returns patch version token" do - expect(described_class.create("1").patch).to be nil - expect(described_class.create("1.2").patch).to be nil + expect(described_class.create("1").patch).to be_nil + expect(described_class.create("1.2").patch).to be_nil expect(described_class.create("1.2.3").patch).to be == Version::Token.create("3") expect(described_class.create("1.2.3alpha").patch).to be == Version::Token.create("3") expect(described_class.create("1.2.3alpha4").patch).to be == Version::Token.create("3")