summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormagnusrodseth <59113973+magnusrodseth@users.noreply.github.com>2022-08-17 16:43:48 +0200
committermagnusrodseth <59113973+magnusrodseth@users.noreply.github.com>2022-08-17 16:43:48 +0200
commit0aff5340b5e225b394ac0fdf496824eaa201e19c (patch)
tree8c434dcf6f61cf25838c7df42f00b9194ce5a69e /tests
parent6f44cb1dd237f4d53aa3ecd4676e50cf850c99fe (diff)
test: Add integration tests
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 0be191f..1a72923 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -111,6 +111,27 @@ fn run_single_test_no_exercise() {
}
#[test]
+fn reset_single_exercise() {
+ Command::cargo_bin("rustlings")
+ .unwrap()
+ .args(&["reset", "intro1"])
+ .assert()
+ .code(0);
+}
+
+#[test]
+fn reset_no_exercise() {
+ Command::cargo_bin("rustlings")
+ .unwrap()
+ .arg("reset")
+ .assert()
+ .code(1)
+ .stderr(predicates::str::contains(
+ "positional arguments not provided",
+ ));
+}
+
+#[test]
fn get_hint_for_single_test() {
Command::cargo_bin("rustlings")
.unwrap()
@@ -126,7 +147,7 @@ fn all_exercises_require_confirmation() {
for exercise in glob("exercises/**/*.rs").unwrap() {
let path = exercise.unwrap();
if path.file_name().unwrap() == "mod.rs" {
- continue
+ continue;
}
let source = {
let mut file = File::open(&path).unwrap();