From 8ad5f9bf531a4848b1104b7b389a20171624c82f Mon Sep 17 00:00:00 2001 From: Abdou Seck Date: Thu, 4 Jun 2020 10:31:17 -0400 Subject: feat: Add a --nocapture option to display test harnesses' outputs This new feature can be accessed by invoking rustlings with --nocapture. Both unit and integration tests added. closes #262 BREAKING CHANGES: The following function take a new boolean argument: * `run` * `verify` * `test` * `compile_and_test` --- tests/integration_tests.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/integration_tests.rs') diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 683e564..0f49b5a 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -159,3 +159,25 @@ fn run_test_exercise_does_not_prompt() { .code(0) .stdout(predicates::str::contains("I AM NOT DONE").not()); } + +#[test] +fn run_single_test_success_with_output() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["--nocapture", "r", "testSuccess"]) + .current_dir("tests/fixture/success/") + .assert() + .code(0) + .stdout(predicates::str::contains("THIS TEST TOO SHALL PAS")); +} + +#[test] +fn run_single_test_success_without_output() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["r", "testSuccess"]) + .current_dir("tests/fixture/success/") + .assert() + .code(0) + .stdout(predicates::str::contains("THIS TEST TOO SHALL PAS").not()); +} \ No newline at end of file -- cgit v1.2.3