Self-sufficient tests
Eliminate any code outside of test_that()
:
If the code is at top-level: Objects or functions defined there will have a test file scope.
If top-level code is interleaved between test_that()
calls: Objects or functions defined there will have a partial file scope.