Skip to content

Commit d898f06

Browse files
fix specs
Signed-off-by: Lamont Granquist <[email protected]>
1 parent 9168352 commit d898f06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/unit/health_check_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def mkdump(base, size, x64 = false)
119119

120120
let(:failed_list) do
121121
double("Mixlib::Shellout",
122-
error!: true,
122+
error!: { raise "Mixlib::Shellout::ShellCommandFailed" }
123123
stdout: <<~EOH
124124
/opt/chefdk/shouldnt/matter
125125
EOH
@@ -206,23 +206,23 @@ def mkdump(base, size, x64 = false)
206206
.with("find /opt/chefdk/ -type f")
207207
.and_return(empty_list)
208208

209-
expect { subject.run! }.to raise_error(HealthCheckFailed)
209+
expect { subject.run! }.to raise_error(RuntimeError, "Internal Error: Health Check found no lines")
210210
end
211211

212212
it "raises an exception if the file list command raises" do
213213
allow(subject).to receive(:shellout)
214214
.with("find /opt/chefdk/ -type f")
215215
.and_return(failed_list)
216216

217-
expect { subject.run! }.to raise_error(HealthCheckFailed)
217+
expect { subject.run! }.to raise_error(RuntimeError, "Mixlib::Shellout::ShellCommandFailed")
218218
end
219219

220220
it "raises an exception if the file list command has no entries in the install_dir" do
221221
allow(subject).to receive(:shellout)
222222
.with("find /opt/chefdk/ -type f")
223223
.and_return(bad_list)
224224

225-
expect { subject.run! }.to raise_error(HealthCheckFailed)
225+
expect { subject.run! }.to raise_error(RuntimeError, "Internal Error: Health Check lines not matching the install_dir")
226226
end
227227
end
228228
end

0 commit comments

Comments
 (0)