Skip to content

fix(assert): Be explicit about spawn failure #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
<a name="1.0.1"></a>
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

<!-- next-header -->

## [Unreleased] - ReleaseDate

#### Fixes

- Be explicit about spawn failure (closes [#109](https://github.com/assert-rs/assert_cmd/issues/109)).

## 1.0.1 (2020-03-30)

#### Fixes

- Reduce dependencies.

<a name="1.0.0"></a>
## 1.0.0 (2020-03-26)

Stable release!

<a name="0.12.2"></a>
## 0.12.2 (2020-03-26)

#### Features

* **cmd**:
* Support timeouts (closes [#10](https://github.com/assert-rs/assert_cmd/issues/20)).

<a name="0.12.1"></a>
## 0.12.1 (2020-03-25)


Expand All @@ -27,7 +37,6 @@ Stable release!
* **cmd**:
* Avoid stdin/stdout deadlocks by writing/reading in parallel (closes [#42](https://github.com/assert-rs/assert_cmd/issues/42)).

<a name="0.12.0"></a>
## 0.12.0 (2019-12-05)


Expand All @@ -43,7 +52,6 @@ Stable release!



<a name="0.11.1"></a>
## 0.11.1 (2019-03-23)


Expand All @@ -53,7 +61,6 @@ Stable release!



<a name="0.11.0"></a>
## 0.11.0 (2019-01-29)


Expand All @@ -68,7 +75,6 @@ Stable release!
* See the [`assert_cmd::cargo` docs](https://docs.rs/assert_cmd/0.11.0/assert_cmd/cargo/index.html) for trade-offs with when to use `escargot` vs `assert_cmd`


<a name="0.10.2"></a>
## 0.10.2 (2018-11-21)


Expand All @@ -81,7 +87,6 @@ Stable release!



<a name="0.10.1"></a>
## 0.10.1 (2018-10-10)


Expand All @@ -90,7 +95,6 @@ Stable release!
* Documentation fixes


<a name="0.10.0"></a>
## 0.10.0 (2018-10-10)


Expand All @@ -107,7 +111,6 @@ Stable release!



<a name="0.9.1"></a>
## 0.9.1 (2018-08-09)


Expand All @@ -117,7 +120,6 @@ Stable release!



<a name="0.9.0"></a>
## 0.9.0 (2018-08-02)


Expand All @@ -140,7 +142,6 @@ Stable release!



<a name="0.5.0"></a>
## 0.6.0 (2018-07-18)


Expand All @@ -154,7 +155,6 @@ Stable release!



<a name="0.5.0"></a>
## 0.5.0 (2018-07-13)


Expand All @@ -168,7 +168,6 @@ Stable release!



<a name="0.4.0"></a>
## 0.4.0 (2018-06-28)


Expand All @@ -188,7 +187,6 @@ Stable release!



<a name="0.3.0"></a>
## 0.3.0 (2018-06-07)

### Features
Expand All @@ -200,7 +198,6 @@ Stable release!
* Moved all cargo stuff under `cargo` module.


<a name="0.2.0"></a>
## 0.2.0 (2018-06-06)


Expand All @@ -216,3 +213,7 @@ Stable release!

* Change to predicates v0.5.0 ([5fa02435](https://github.com/assert-rs/assert_cmd/commit/5fa02435ffee0a3fb5f94fa374437ae71201f7d7))
* Simplify stdout/stderr str predicates ([8cdfb91e](https://github.com/assert-rs/assert_cmd/commit/8cdfb91e0f7a535d3d2b9fbb21f0df5d236a0f0a), closes [#11](https://github.com/assert-rs/assert_cmd/issues/11))


<!-- next-url -->
[Unreleased]: https://github.com/assert-rs/assert_cmd/compare/v1.0.1...HEAD
5 changes: 5 additions & 0 deletions release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ tag-name = "{{prefix}}v{{version}}"
pre-release-replacements = [
{file="README.md", search="assert_cmd = .*", replace="assert_cmd = \"{{version}}\""},
{file="src/lib.rs", search="assert_cmd = .*", replace="assert_cmd = \"{{version}}\""},
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}"},
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}"},
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"},
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate"},
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/assert-rs/predicates-rs/compare/{{tag_name}}...HEAD"},
]
7 changes: 6 additions & 1 deletion src/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ impl OutputAssertExt for process::Output {

impl<'c> OutputAssertExt for &'c mut process::Command {
fn assert(self) -> Assert {
let output = self.output().unwrap();
let output = match self.output() {
Ok(output) => output,
Err(err) => {
panic!("Failed to spawn {:?}: {}", self, err);
}
};
Assert::new(output).append_context("command", format!("{:?}", self))
}
}
Expand Down