diff options
| author | Roberto Vidal <vidal.roberto.j@gmail.com> | 2019-11-12 11:35:40 +0100 |
|---|---|---|
| committer | Roberto Vidal <vidal.roberto.j@gmail.com> | 2019-11-12 11:35:40 +0100 |
| commit | 4b26546589f7d2b50455429482cf1f386ceae8b3 (patch) | |
| tree | 66ff06c0bf1fb6dce88485212148a2c5b2e167d8 /tests/integration_tests.rs | |
| parent | bc56788fe637f6ff16c1e445a230b01544d2d9cf (diff) | |
fix(run): makes `run` never prompt
`watch` and `verify` do prompt the user to actively move to the
next exercise. This change fixes `run` to never prompt. Previously
it was inconsistent between "test" and "compile" exercises.
BREAKING CHANGE: we again change the behavior of the `run` command
Diffstat (limited to 'tests/integration_tests.rs')
| -rw-r--r-- | tests/integration_tests.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 754aa63..7131700 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,5 +1,6 @@ use assert_cmd::prelude::*; use glob::glob; +use predicates::boolean::PredicateBooleanExt; use std::fs::File; use std::io::Read; use std::process::Command; @@ -136,3 +137,25 @@ fn all_exercises_require_confirmation() { )); } } + +#[test] +fn run_compile_exercise_does_not_prompt() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["r", "pending_exercise"]) + .current_dir("tests/fixture/state") + .assert() + .code(0) + .stdout(predicates::str::contains("I AM NOT DONE").not()); +} + +#[test] +fn run_test_exercise_does_not_prompt() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["r", "pending_test_exercise"]) + .current_dir("tests/fixture/state") + .assert() + .code(0) + .stdout(predicates::str::contains("I AM NOT DONE").not()); +} |
