Skip to content

Commit 0aff534

Browse files
committed
test: Add integration tests
1 parent 6f44cb1 commit 0aff534

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/integration_tests.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,27 @@ fn run_single_test_no_exercise() {
110110
.code(1);
111111
}
112112

113+
#[test]
114+
fn reset_single_exercise() {
115+
Command::cargo_bin("rustlings")
116+
.unwrap()
117+
.args(&["reset", "intro1"])
118+
.assert()
119+
.code(0);
120+
}
121+
122+
#[test]
123+
fn reset_no_exercise() {
124+
Command::cargo_bin("rustlings")
125+
.unwrap()
126+
.arg("reset")
127+
.assert()
128+
.code(1)
129+
.stderr(predicates::str::contains(
130+
"positional arguments not provided",
131+
));
132+
}
133+
113134
#[test]
114135
fn get_hint_for_single_test() {
115136
Command::cargo_bin("rustlings")
@@ -126,7 +147,7 @@ fn all_exercises_require_confirmation() {
126147
for exercise in glob("exercises/**/*.rs").unwrap() {
127148
let path = exercise.unwrap();
128149
if path.file_name().unwrap() == "mod.rs" {
129-
continue
150+
continue;
130151
}
131152
let source = {
132153
let mut file = File::open(&path).unwrap();

0 commit comments

Comments
 (0)