|
49 | 49 | ) |
50 | 50 | .and_return(instance_double(SystemCommand::Result, stdout: unknown_response)) |
51 | 51 |
|
52 | | - expect(fake_system_command).to receive(:run!) |
53 | | - .with("/bin/launchctl", args: ["remove", "my.fancy.package.service"], sudo: false, sudo_as_root: false) |
54 | | - .and_return(instance_double(SystemCommand::Result)) |
| 52 | + expect(fake_system_command).to receive(:run) |
| 53 | + .with("/bin/launchctl", args: ["remove", "my.fancy.package.service"], |
| 54 | + must_succeed: false, sudo: false, sudo_as_root: false) |
| 55 | + .and_return(instance_double(SystemCommand::Result, success?: true)) |
55 | 56 |
|
56 | 57 | subject.public_send(:"#{artifact_dsl_key}_phase", command: fake_system_command) |
57 | 58 | end |
|
76 | 77 | ) |
77 | 78 | .and_return(instance_double(SystemCommand::Result, stdout: service_info)) |
78 | 79 |
|
79 | | - expect(fake_system_command).to receive(:run!) |
80 | | - .with("/bin/launchctl", args: ["remove", "my.fancy.package.service"], sudo: true, sudo_as_root: true) |
81 | | - .and_return(instance_double(SystemCommand::Result)) |
| 80 | + expect(fake_system_command).to receive(:run) |
| 81 | + .with("/bin/launchctl", args: ["remove", "my.fancy.package.service"], |
| 82 | + must_succeed: true, sudo: true, sudo_as_root: true) |
| 83 | + .and_return(instance_double(SystemCommand::Result, success?: true)) |
82 | 84 |
|
83 | 85 | subject.public_send(:"#{artifact_dsl_key}_phase", command: fake_system_command) |
84 | 86 | end |
|
136 | 138 | ) |
137 | 139 | .and_return(instance_double(SystemCommand::Result, stdout: service_info)) |
138 | 140 |
|
139 | | - expect(fake_system_command).to receive(:run!) |
140 | | - .with("/bin/launchctl", args: ["remove", "my.fancy.package.service.12345"], sudo: true, sudo_as_root: true) |
141 | | - .and_return(instance_double(SystemCommand::Result)) |
| 141 | + expect(fake_system_command).to receive(:run) |
| 142 | + .with("/bin/launchctl", args: ["remove", "my.fancy.package.service.12345"], |
| 143 | + must_succeed: true, sudo: true, sudo_as_root: true) |
| 144 | + .and_return(instance_double(SystemCommand::Result, success?: true)) |
142 | 145 |
|
143 | 146 | subject.public_send(:"#{artifact_dsl_key}_phase", command: fake_system_command) |
144 | 147 | end |
|
0 commit comments