From b58c0914f4d85faa39f22eb3408970ac8a176913 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Thu, 29 Jan 2015 10:00:43 -0500 Subject: Run multiple files on runner --- railties/test/test_unit/runner_test.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'railties/test/test_unit/runner_test.rb') 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 -- cgit v1.2.3