Skip to content

Commit

Permalink
run test_test.rb using the bin/rails test.
Browse files Browse the repository at this point in the history
  • Loading branch information
senny committed Mar 18, 2015
1 parent 8017e6a commit d9bbafb
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions railties/test/application/test_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,7 @@ def assert_successful_test_run(name)
end

def run_test_file(name, options = {})
ruby '-Itest', "#{app_path}/test/#{name}", options.deep_merge(env: {"RAILS_ENV" => "test"})
end

def ruby(*args)
options = args.extract_options!
env = options.fetch(:env, {})
env["RUBYLIB"] = $:.join(':')

Dir.chdir(app_path) do
`#{env_string(env)} #{Gem.ruby} #{args.join(' ')} 2>&1`
end
end

def env_string(variables)
variables.map do |key, value|
"#{key}='#{value}'"
end.join " "
Dir.chdir(app_path) { `bin/rails test "#{app_path}/test/#{name}" 2>&1` }
end
end
end

0 comments on commit d9bbafb

Please sign in to comment.