Skip to content

Commit 0a4b064

Browse files
committed
Fix specs
1 parent 5177db7 commit 0a4b064

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Library/Homebrew/service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def run(command = nil, macos: nil, linux: nil)
9393
if command
9494
@run_params = command
9595
elsif macos || linux
96-
@run_params = { macos:, linux: }.compact, T.any(RunParam, T::Hash[Symbol, RunParam])
96+
@run_params = { macos:, linux: }.compact
9797
end
9898

9999
command ||= on_system_conditional(macos:, linux:)
@@ -569,7 +569,7 @@ def to_hash
569569
process_type: @process_type,
570570
macos_legacy_timers: @macos_legacy_timers,
571571
sockets: sockets_var,
572-
}.compact
572+
}.compact_blank
573573
end
574574

575575
# Turn the service API hash values back into what is expected by the formula DSL.

Library/Homebrew/test/service_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ def stub_formula_with_service_sockets(sockets_var)
984984
expect(command).to eq(["#{HOMEBREW_PREFIX}/opt/#{name}/bin/beanstalkd", "test"])
985985
end
986986

987-
it "returns nil on Linux", :needs_linux do
987+
it "returns empty on Linux", :needs_linux do
988988
f = stub_formula do
989989
service do
990990
run macos: [opt_bin/"beanstalkd", "test"]
@@ -993,7 +993,7 @@ def stub_formula_with_service_sockets(sockets_var)
993993
end
994994

995995
command = f.service.command
996-
expect(command).to be_nil
996+
expect(command).to be_empty
997997
end
998998

999999
it "returns @run data on macOS", :needs_macos do
@@ -1008,7 +1008,7 @@ def stub_formula_with_service_sockets(sockets_var)
10081008
expect(command).to eq(["#{HOMEBREW_PREFIX}/opt/#{name}/bin/beanstalkd", "test"])
10091009
end
10101010

1011-
it "returns nil on macOS", :needs_macos do
1011+
it "returns empty on macOS", :needs_macos do
10121012
f = stub_formula do
10131013
service do
10141014
run linux: [opt_bin/"beanstalkd", "test"]
@@ -1017,7 +1017,7 @@ def stub_formula_with_service_sockets(sockets_var)
10171017
end
10181018

10191019
command = f.service.command
1020-
expect(command).to be_nil
1020+
expect(command).to be_empty
10211021
end
10221022

10231023
it "returns appropriate @run data on Linux", :needs_linux do

0 commit comments

Comments
 (0)