diff options
| author | Abdou Seck <djily02016@gmail.com> | 2020-06-04 10:31:17 -0400 |
|---|---|---|
| committer | Abdou Seck <djily02016@gmail.com> | 2020-06-04 11:18:26 -0400 |
| commit | 8ad5f9bf531a4848b1104b7b389a20171624c82f (patch) | |
| tree | 331c5d3725140b07d836ed8be6df30c8ddfd63fb /tests/integration_tests.rs | |
| parent | 02a2fe48714a4546b28d38fb611e6bfce9f43cf6 (diff) | |
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`
Diffstat (limited to 'tests/integration_tests.rs')
| -rw-r--r-- | tests/integration_tests.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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 |
