diff options
author | Arthur Neves <arthurnn@gmail.com> | 2015-01-29 10:00:43 -0500 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-18 09:52:18 +0100 |
commit | b58c0914f4d85faa39f22eb3408970ac8a176913 (patch) | |
tree | 339361a7e1a084bd0ed3d563b4362e3c503ce2a1 /railties/test | |
parent | 090c83672f333d6a4d87752ca1f980bfb6be6849 (diff) | |
download | rails-b58c0914f4d85faa39f22eb3408970ac8a176913.tar.gz rails-b58c0914f4d85faa39f22eb3408970ac8a176913.tar.bz2 rails-b58c0914f4d85faa39f22eb3408970ac8a176913.zip |
Run multiple files on runner
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/test_unit/runner_test.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/railties/test/test_unit/runner_test.rb b/railties/test/test_unit/runner_test.rb index cd0c66a5f7..9690893a0e 100644 --- a/railties/test/test_unit/runner_test.rb +++ b/railties/test/test_unit/runner_test.rb @@ -58,12 +58,26 @@ class TestUnitTestRunnerTest < ActiveSupport::TestCase test "run all tests in a directory" do options = @options.parse([__dir__]) - assert_equal "#{__dir__}/**/*_test.rb", options[:pattern] + assert_equal ["#{__dir__}/**/*_test.rb"], options[:patterns] assert_nil options[:filename] assert_nil options[:line] end test "run multiple files" do - skip "needs implementation" + application_dir = File.expand_path("#{__dir__}/../application") + options = @options.parse([__dir__, application_dir]) + + assert_equal ["#{__dir__}/**/*_test.rb", "#{application_dir}/**/*_test.rb"], options[:patterns] + assert_nil options[:filename] + assert_nil options[:line] + end + + test "run multiple files and run one file by line" do + line = __LINE__ + options = @options.parse([__dir__, "#{__FILE__}:#{line}"]) + + assert_equal ["#{__dir__}/**/*_test.rb"], options[:patterns] + assert_equal __FILE__, options[:filename] + assert_equal line, options[:line] end end |