diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-19 14:27:01 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-19 14:27:01 +0100 |
commit | 9959e9525b9bd3324288c87f1c791cbb488c36c8 (patch) | |
tree | 02d13ea832fbd79f451bb9d24de0ba09e30e8894 /railties/lib/rails/commands | |
parent | bee9434cdf4f56dc51027a8890cf04f506544735 (diff) | |
parent | d9bbafb2e79bbaee93648b7ee5138a0dbd7e8277 (diff) | |
download | rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.tar.gz rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.tar.bz2 rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.zip |
Merge pull request #19216 from senny/bin_test_runner
`bin/rails test` runner (rerun snippets, run tests by line, option documentation)
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/commands_tasks.rb | 7 | ||||
-rw-r--r-- | railties/lib/rails/commands/test.rb | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/commands_tasks.rb b/railties/lib/rails/commands/commands_tasks.rb index 8bae08e44e..d8d4080c3e 100644 --- a/railties/lib/rails/commands/commands_tasks.rb +++ b/railties/lib/rails/commands/commands_tasks.rb @@ -14,6 +14,7 @@ The most common rails commands are: generate Generate new code (short-cut alias: "g") console Start the Rails console (short-cut alias: "c") server Start the Rails server (short-cut alias: "s") + test Run tests (short-cut alias: "t") dbconsole Start a console for the database specified in config/database.yml (short-cut alias: "db") new Create a new Rails application. "rails new my_app" creates a @@ -27,7 +28,7 @@ In addition to those, there are: All commands can be run with -h (or --help) for more information. EOT - COMMAND_WHITELIST = %w(plugin generate destroy console server dbconsole runner new version help) + COMMAND_WHITELIST = %w(plugin generate destroy console server dbconsole runner new version help test) def initialize(argv) @argv = argv @@ -81,6 +82,10 @@ EOT end end + def test + require_command!("test") + end + def dbconsole require_command!("dbconsole") Rails::DBConsole.start diff --git a/railties/lib/rails/commands/test.rb b/railties/lib/rails/commands/test.rb new file mode 100644 index 0000000000..598e224a6f --- /dev/null +++ b/railties/lib/rails/commands/test.rb @@ -0,0 +1,5 @@ +require "rails/test_unit/runner" + +$: << File.expand_path("../../test", APP_PATH) + +Rails::TestRunner.run(ARGV) |