Skip to content

Commit 69202f1

Browse files
authored
Merge pull request #110 from epage/unwrap
fix(assert): Be explicit about spawn failure
2 parents b4d4beb + f7d6e8a commit 69202f1

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

CHANGELOG.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
<a name="1.0.1"></a>
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
<!-- next-header -->
8+
9+
## [Unreleased] - ReleaseDate
10+
11+
#### Fixes
12+
13+
- Be explicit about spawn failure (closes [#109](https://github.com/assert-rs/assert_cmd/issues/109)).
14+
215
## 1.0.1 (2020-03-30)
316

417
#### Fixes
518

619
- Reduce dependencies.
720

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

1123
Stable release!
1224

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

1627
#### Features
1728

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

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

2434

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

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

3342

@@ -43,7 +52,6 @@ Stable release!
4352

4453

4554

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

4957

@@ -53,7 +61,6 @@ Stable release!
5361

5462

5563

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

5966

@@ -68,7 +75,6 @@ Stable release!
6875
* 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`
6976

7077

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

7480

@@ -81,7 +87,6 @@ Stable release!
8187

8288

8389

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

8792

@@ -90,7 +95,6 @@ Stable release!
9095
* Documentation fixes
9196

9297

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

96100

@@ -107,7 +111,6 @@ Stable release!
107111

108112

109113

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

113116

@@ -117,7 +120,6 @@ Stable release!
117120

118121

119122

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

123125

@@ -140,7 +142,6 @@ Stable release!
140142

141143

142144

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

146147

@@ -154,7 +155,6 @@ Stable release!
154155

155156

156157

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

160160

@@ -168,7 +168,6 @@ Stable release!
168168

169169

170170

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

174173

@@ -188,7 +187,6 @@ Stable release!
188187

189188

190189

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

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

202200

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

206203

@@ -216,3 +213,7 @@ Stable release!
216213

217214
* Change to predicates v0.5.0 ([5fa02435](https://github.com/assert-rs/assert_cmd/commit/5fa02435ffee0a3fb5f94fa374437ae71201f7d7))
218215
* 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))
216+
217+
218+
<!-- next-url -->
219+
[Unreleased]: https://github.com/assert-rs/assert_cmd/compare/v1.0.1...HEAD

release.toml

+5
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ tag-name = "{{prefix}}v{{version}}"
55
pre-release-replacements = [
66
{file="README.md", search="assert_cmd = .*", replace="assert_cmd = \"{{version}}\""},
77
{file="src/lib.rs", search="assert_cmd = .*", replace="assert_cmd = \"{{version}}\""},
8+
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}"},
9+
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}"},
10+
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"},
11+
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate"},
12+
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/assert-rs/predicates-rs/compare/{{tag_name}}...HEAD"},
813
]

src/assert.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ impl OutputAssertExt for process::Output {
5757

5858
impl<'c> OutputAssertExt for &'c mut process::Command {
5959
fn assert(self) -> Assert {
60-
let output = self.output().unwrap();
60+
let output = match self.output() {
61+
Ok(output) => output,
62+
Err(err) => {
63+
panic!("Failed to spawn {:?}: {}", self, err);
64+
}
65+
};
6166
Assert::new(output).append_context("command", format!("{:?}", self))
6267
}
6368
}

0 commit comments

Comments
 (0)