-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow --unstable to be set with an environment variable
Allow the environment variable JUST_ALLOW_UNSTABLE=true to act as equivalent to the --unstable flag. Any other value of JUST_ALLOW_UNSTABLE is treated as false.
- Loading branch information
Showing
5 changed files
with
42 additions
and
3 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
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,31 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn set_unstable_true_with_env_var() { | ||
let justfile = r#" | ||
default: | ||
echo 'foo' | ||
"#; | ||
Test::new() | ||
.justfile(justfile) | ||
.args(["--dump", "--dump-format", "json"]) | ||
.env("JUST_ALLOW_UNSTABLE", "true") | ||
.status(EXIT_SUCCESS) | ||
.stdout_regex("*") | ||
.run(); | ||
} | ||
|
||
#[test] | ||
fn set_unstable_false_with_env_var() { | ||
let justfile = r#" | ||
default: | ||
echo 'foo' | ||
"#; | ||
Test::new() | ||
.justfile(justfile) | ||
.args(["--dump", "--dump-format", "json"]) | ||
.env("JUST_ALLOW_UNSTABLE", "false") | ||
.status(EXIT_FAILURE) | ||
.stderr("error: The JSON dump format is currently unstable. Invoke `just` with the `--unstable` flag to enable unstable features.\n") | ||
.run(); | ||
} |