Skip to content

Commit

Permalink
cargo-insta: allow multiple --exclude flags (#520)
Browse files Browse the repository at this point in the history
Fixes #519
  • Loading branch information
ajwerner authored Jul 10, 2024
1 parent 6a9a4ac commit 747d6a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ All notable changes to insta and cargo-insta are documented here.

- Mark `require-full-match` as experimental, given some corner-cases are currently difficult to manage. #497

- `cargo insta test` now accepts multiple `--exclude` flags. #520

## 1.39.0

- Fixed a bug in `require_full_match`. #485
Expand Down
4 changes: 2 additions & 2 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct TestCommand {
package: Vec<String>,
/// Exclude packages from the test
#[structopt(long, value_name = "SPEC")]
exclude: Option<String>,
exclude: Vec<String>,
/// Disable force-passing of snapshot tests
#[structopt(long)]
no_force_pass: bool,
Expand Down Expand Up @@ -866,7 +866,7 @@ fn prepare_test_runner<'snapshot_ref>(
proc.arg("--package");
proc.arg(pkg);
}
if let Some(ref spec) = cmd.exclude {
for spec in &cmd.exclude {
proc.arg("--exclude");
proc.arg(spec);
}
Expand Down

0 comments on commit 747d6a7

Please sign in to comment.