Skip to content

Commit

Permalink
test: Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusrodseth committed Aug 17, 2022
1 parent 6f44cb1 commit 0aff534
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ fn run_single_test_no_exercise() {
.code(1);
}

#[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")
Expand All @@ -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();
Expand Down

0 comments on commit 0aff534

Please sign in to comment.