Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Dec 18, 2024
1 parent ee4ef6b commit 9be9467
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

- Removed the `--global` option from `proto alias`, `unalias`, `pin`, and `unpin`, use `--to` or `--from` instead.

## Unreleased

- Added a `--yes` option to `proto outdated`, that skips confirmation prompts.

## 0.43.2

#### 🐞 Fixes
Expand Down
5 changes: 4 additions & 1 deletion crates/cli/src/commands/outdated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ pub struct OutdatedArgs {
help = "Update and write the versions to their respective configuration"
)]
update: bool,

#[arg(long, help = "Avoid and force confirm prompts", env = "PROTO_YES")]
yes: bool,
}

#[derive(Serialize)]
Expand Down Expand Up @@ -261,7 +264,7 @@ pub async fn outdated(session: ProtoSession, args: OutdatedArgs) -> AppResult {
})
.await?;

if confirmed {
if args.yes || confirmed {
let mut updates: BTreeMap<PathBuf, BTreeMap<Id, UnresolvedVersionSpec>> = BTreeMap::new();

for (id, item) in &items {
Expand Down
2 changes: 2 additions & 0 deletions crates/cli/tests/outdated_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ mod outdated {
.arg("--update")
.arg("--config-mode")
.arg("upwards-global")
.arg("--yes")
.current_dir(sandbox.path().join("a/b"));
})
.success();
Expand All @@ -145,6 +146,7 @@ mod outdated {
.arg("--config-mode")
.arg("upwards-global")
.arg("--latest")
.arg("--yes")
.current_dir(sandbox.path().join("a/b"));
})
.success();
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/plugin_search_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod plugin_search {
})
.success();

assert.stdout(predicate::str::contains("Available for query: zig"));
assert.stdout(predicate::str::contains("Search results for: zig"));
}

#[test]
Expand Down

0 comments on commit 9be9467

Please sign in to comment.