diff options
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 + )); + } +} |
