diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 81fb883b6b..1426ffe837 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -167,7 +167,7 @@ class SystemCommand args: T::Array[T.any(String, Integer, Float, Pathname, URI::Generic)], sudo: T::Boolean, sudo_as_root: T::Boolean, - env: T::Hash[String, T.nilable(String)], + env: T::Hash[String, T.any(NilClass, String, T::Boolean)], input: T.any(String, T::Array[String]), must_succeed: T::Boolean, print_stdout: T.any(T::Boolean, Symbol), @@ -376,7 +376,7 @@ class SystemCommand sig { params( - env: T::Hash[String, String], + env: T::Hash[String, T.nilable(String)], executable: String, args: String, options: T.untyped, diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 76fd83778b..b715f3c4d6 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -440,7 +440,7 @@ RSpec.describe Homebrew::DevCmd::Bottle do old_spec = BottleSpecification.new old_spec.rebuild(1) new_hash = { "rebuild" => 2 } - expect(homebrew.merge_bottle_spec(["rebuild"], old_spec, new_hash)).to eq [ + expect(homebrew.merge_bottle_spec([:rebuild], old_spec, new_hash)).to eq [ ['rebuild: old: "1", new: "2"'], [], ] diff --git a/Library/Homebrew/test/download_strategies/curl_spec.rb b/Library/Homebrew/test/download_strategies/curl_spec.rb index 28e478e47c..623f6573a8 100644 --- a/Library/Homebrew/test/download_strategies/curl_spec.rb +++ b/Library/Homebrew/test/download_strategies/curl_spec.rb @@ -191,7 +191,7 @@ RSpec.describe CurlDownloadStrategy do hash_including(args: array_including_cons("#{artifact_domain}/#{resource_path}")), ) .at_least(:once) - .and_return(SystemCommand::Result.new(["curl"], [""], status, secrets: [])) + .and_return(SystemCommand::Result.new(["curl"], [[:stdout, ""]], status, secrets: [])) strategy.fetch end diff --git a/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb b/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb index 39553a28d0..6bbd74898d 100644 --- a/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb @@ -110,7 +110,10 @@ RSpec.describe Homebrew::Livecheck::Strategy::HeaderMatch do it "errors on an invalid return type from a block" do expect { header_match.versions_from_headers(headers) { 123 } } - .to raise_error(TypeError, Homebrew::Livecheck::Strategy::INVALID_BLOCK_RETURN_VALUE_MSG) + .to raise_error( + TypeError, + /#{Homebrew::Livecheck::Strategy::INVALID_BLOCK_RETURN_VALUE_MSG}|Expected type T::Hash\[String, String\]/o, + ) end end end