MCPcopy Create free account
hub / github.com/assert-rs/assert_cmd / try_success

Method try_success

src/assert.rs:170–176  ·  view source on GitHub ↗

`try_` variant of [`Assert::success`].

(self)

Source from the content-addressed store, hash-verified

168
169 /// `try_` variant of [`Assert::success`].
170 pub fn try_success(self) -> AssertResult {
171 if !self.output.status.success() {
172 let actual_code = self.output.status.code();
173 return Err(self.into_error(AssertReason::UnexpectedFailure { actual_code }));
174 }
175 Ok(self)
176 }
177
178 /// Ensure the command failed.
179 ///

Callers 1

successMethod · 0.80

Calls 3

successMethod · 0.80
codeMethod · 0.80
into_errorMethod · 0.80

Tested by

no test coverage detected