-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prefix all messages (event error messages) with check on quiet (#140)
This resolves #139 by silencing all (except CL parsing) messages when the user requests `--silent`. Namely ``` if ! denv check --workspace --silent; then denv init owner/repo:tag fi ``` can quietly insure that a workspace has been initialized in scripts while still allowing `denv init` to prompt the user about creating the workspace directory if need be. If script writers want to avoid all prompts, look towards the --[no-]over and --[no-]mkdir flags for the `denv init` command. Updates to the testing and manual have been included as well.
- Loading branch information
1 parent
41960e7
commit e17752e
Showing
4 changed files
with
88 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bats | ||
|
||
setup() { | ||
load "test_helper/denv" | ||
common_setup | ||
|
||
go_to_tmp_work | ||
} | ||
|
||
teardown() { | ||
clean_tmp_work | ||
} | ||
|
||
@test "basic check run" { | ||
run -0 denv check | ||
assert_output --partial "denv would run with '${DENV_RUNNER}'" | ||
} | ||
|
||
@test "quiet check run" { | ||
run -0 denv check --quiet | ||
refute_output | ||
} | ||
|
||
@test "quiet but not silent check run" { | ||
run -4 denv check --workspace --quiet | ||
assert_output | ||
run -0 denv init alpine:latest | ||
run -0 denv check --workspace --quiet | ||
refute_output | ||
} | ||
|
||
@test "silent check run" { | ||
run -4 denv check --workspace --silent | ||
refute_output | ||
} | ||
|
||
@test "check fails when using unsupported runner" { | ||
export DENV_RUNNER=dne | ||
run -3 denv check | ||
assert_output --partial "runner is not supported by denv" | ||
} | ||
|
||
@test "check that we are in a workspace" { | ||
run -0 denv init alpine:latest | ||
run -0 denv check --workspace | ||
assert_output --partial "Found denv_workspace" | ||
} | ||
|
||
@test "check that we are not in a workspace" { | ||
run -4 denv check --workspace | ||
assert_output --partial "Unable to deduce a denv workspace" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters