diff options
| author | Roberto Vidal <vidal.roberto.j@gmail.com> | 2019-11-11 13:38:24 +0100 |
|---|---|---|
| committer | Roberto Vidal <vidal.roberto.j@gmail.com> | 2019-11-11 16:23:35 +0100 |
| commit | 2cdd61294f0d9a53775ee24ad76435bec8a21e60 (patch) | |
| tree | 36442292a4e3b0ae07072b0dfaf59a3bc799a397 /tests/integration_tests.rs | |
| parent | a47a62172a5d4c479d242498b9b140b3111fb7c6 (diff) | |
feat: improve `watch` execution mode
The `watch` command now requires user action to move to the next
exercise.
BREAKING CHANGE: this changes the behavior of `watch`.
Diffstat (limited to 'tests/integration_tests.rs')
| -rw-r--r-- | tests/integration_tests.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 3acaf90..897cd2a 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,4 +1,7 @@ use assert_cmd::prelude::*; +use glob::glob; +use std::fs::File; +use std::io::Read; use std::process::Command; #[test] @@ -105,3 +108,20 @@ fn run_single_test_no_exercise() { .assert() .code(1); } + +#[test] +fn all_exercises_require_confirmation() { + for exercise in glob("exercises/**/*.rs").unwrap() { + let path = exercise.unwrap(); + let source = { + let mut file = File::open(&path).unwrap(); + let mut s = String::new(); + file.read_to_string(&mut s).unwrap(); + s + }; + source.matches("// I AM NOT DONE").next().expect(&format!( + "There should be an `I AM NOT DONE` annotation in {:?}", + path + )); + } +} |
