Skip to content
  • Jonathan Hefner's avatar
    613c20bf
    Run test:prepare unless exact tests are specified · 613c20bf
    Jonathan Hefner authored
    Follow-up to #46664.
    
    In #46664, `bin/rails test` _without_ args, `bin/rails test:all`, and
    `bin/rails test:system` were made to run the `test:prepare` task.
    However `bin/rails test` _with_ args (e.g. `bin/rails test --seed 1234`)
    and other `test:*` commands (e.g. `bin/rails test:models`) were not made
    to do so.
    
    This commit changes `bin/rails test` to always run `test:prepare` unless
    exact tests are specified via path arguments (e.g. `bin/rails test
    path/to/test.rb`) or a name pattern (e.g. `bin/rails test -n test_foo`).
    
    This commit also refactors the testing Rake tasks so that all of the
    logic regarding which files to load and whether to run `test:prepare` is
    contained within the `TestCommand` class.
    613c20bf
    Run test:prepare unless exact tests are specified
    Jonathan Hefner authored
    Follow-up to #46664.
    
    In #46664, `bin/rails test` _without_ args, `bin/rails test:all`, and
    `bin/rails test:system` were made to run the `test:prepare` task.
    However `bin/rails test` _with_ args (e.g. `bin/rails test --seed 1234`)
    and other `test:*` commands (e.g. `bin/rails test:models`) were not made
    to do so.
    
    This commit changes `bin/rails test` to always run `test:prepare` unless
    exact tests are specified via path arguments (e.g. `bin/rails test
    path/to/test.rb`) or a name pattern (e.g. `bin/rails test -n test_foo`).
    
    This commit also refactors the testing Rake tasks so that all of the
    logic regarding which files to load and whether to run `test:prepare` is
    contained within the `TestCommand` class.
Loading