diff --git a/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs b/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs index e26fa71096..3822d6b976 100644 --- a/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs +++ b/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs @@ -1,6 +1,6 @@ -use adder; +use adder::add_two; #[test] fn it_adds_two() { - assert_eq!(4, adder::add_two(2)); + assert_eq!(4, add_two(2)); } diff --git a/src/ch11-03-test-organization.md b/src/ch11-03-test-organization.md index 9f26546cf4..918945780a 100644 --- a/src/ch11-03-test-organization.md +++ b/src/ch11-03-test-organization.md @@ -118,8 +118,9 @@ Enter the code in Listing 11-13 into the *tests/integration_test.rs* file: `adder` crate Each file in the `tests` directory is a separate crate, so we need to bring our -library into each test crate’s scope. For that reason we add `use adder` at the -top of the code, which we didn’t need in the unit tests. +library into each test crate’s scope. For that reason we add `use +adder::add_two` at the top of the code, which we didn’t need in the unit +tests. We don’t need to annotate any code in *tests/integration_test.rs* with `#[cfg(test)]`. Cargo treats the `tests` directory specially and compiles files