diff options
author | Arthur Neves <arthurnn@gmail.com> | 2015-03-05 14:20:20 -0500 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2015-03-19 10:15:03 -0400 |
commit | a9eb12393fa1245620533a58ed36f651558ecae8 (patch) | |
tree | c6b3ef4e56e9e11758a005da32fced68f4e5c2f4 /railties/test/test_unit | |
parent | 4bb92684743e56217bf2b465aed6e82797d05b5f (diff) | |
download | rails-a9eb12393fa1245620533a58ed36f651558ecae8.tar.gz rails-a9eb12393fa1245620533a58ed36f651558ecae8.tar.bz2 rails-a9eb12393fa1245620533a58ed36f651558ecae8.zip |
Use absolute path on find_method location for the runner
Diffstat (limited to 'railties/test/test_unit')
-rw-r--r-- | railties/test/test_unit/runner_test.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/test/test_unit/runner_test.rb b/railties/test/test_unit/runner_test.rb index c040c71635..9ea8b2c114 100644 --- a/railties/test/test_unit/runner_test.rb +++ b/railties/test/test_unit/runner_test.rb @@ -41,7 +41,7 @@ class TestUnitTestRunnerTest < ActiveSupport::TestCase test "parse the filename and line" do file = "test/test_unit/runner_test.rb" - absolute_file = __FILE__ + absolute_file = File.expand_path __FILE__ options = @options.parse(["#{file}:20"]) assert_equal absolute_file, options[:filename] assert_equal 20, options[:line] @@ -90,21 +90,22 @@ class TestUnitTestRunnerTest < ActiveSupport::TestCase test "run multiple files and run one file by line" do line = __LINE__ + absolute_file = File.expand_path(__FILE__) options = @options.parse([__dir__, "#{__FILE__}:#{line}"]) assert_equal ["#{__dir__}/**/*_test.rb"], options[:patterns] - assert_equal __FILE__, options[:filename] + assert_equal absolute_file, options[:filename] assert_equal line, options[:line] runner = Rails::TestRunner.new(options) - assert_equal [__FILE__], runner.test_files, 'Only returns the file that running by line' + assert_equal [absolute_file], runner.test_files, 'Only returns the file that running by line' end test "running multiple files passing line number" do line = __LINE__ options = @options.parse(["foobar.rb:8", "#{__FILE__}:#{line}"]) - assert_equal __FILE__, options[:filename], 'Returns the last file' + assert_equal File.expand_path(__FILE__), options[:filename], 'Returns the last file' assert_equal line, options[:line] end end |