mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #10781 from arunagw/run-isolated-test
Running isolated tests
This commit is contained in:
commit
e1b59a268b
4 changed files with 13 additions and 37 deletions
|
@ -22,11 +22,15 @@ Rake::TestTask.new(:test_action_pack) do |t|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :test do
|
namespace :test do
|
||||||
Rake::TestTask.new(:isolated) do |t|
|
task :isolated do
|
||||||
t.libs << 'test'
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
||||||
t.pattern = 'test/ts_isolated.rb'
|
Dir.glob("test/{abstract,controller,dispatch,template}/**/*_test.rb").all? do |file|
|
||||||
|
sh(ruby, '-Ilib:test', file)
|
||||||
|
end or raise "Failures"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
namespace :test do
|
||||||
Rake::TestTask.new(:template) do |t|
|
Rake::TestTask.new(:template) do |t|
|
||||||
t.libs << 'test'
|
t.libs << 'test'
|
||||||
t.pattern = 'test/template/**/*.rb'
|
t.pattern = 'test/template/**/*.rb'
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
require 'active_support/testing/autorun'
|
|
||||||
require 'rbconfig'
|
|
||||||
require 'abstract_unit'
|
|
||||||
|
|
||||||
class TestIsolated < ActiveSupport::TestCase
|
|
||||||
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
|
||||||
|
|
||||||
Dir["#{File.dirname(__FILE__)}/{abstract,controller,dispatch,template}/**/*_test.rb"].each do |file|
|
|
||||||
define_method("test #{file}") do
|
|
||||||
command = "#{ruby} -Ilib:test #{file}"
|
|
||||||
result = silence_stderr { `#{command}` }
|
|
||||||
assert $?.to_i.zero?, "#{command}\n#{result}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -9,12 +9,15 @@ Rake::TestTask.new do |t|
|
||||||
t.verbose = true
|
t.verbose = true
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :test do
|
|
||||||
Rake::TestTask.new(:isolated) do |t|
|
|
||||||
t.pattern = 'test/ts_isolated.rb'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
namespace :test do
|
||||||
|
task :isolated do
|
||||||
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
||||||
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
||||||
|
sh(ruby, '-Ilib:test', file)
|
||||||
|
end or raise "Failures"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
spec = eval(File.read('activesupport.gemspec'))
|
spec = eval(File.read('activesupport.gemspec'))
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
require 'active_support/testing/autorun'
|
|
||||||
require 'active_support/test_case'
|
|
||||||
require 'rbconfig'
|
|
||||||
require 'active_support/core_ext/kernel/reporting'
|
|
||||||
|
|
||||||
class TestIsolated < ActiveSupport::TestCase
|
|
||||||
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
|
||||||
|
|
||||||
Dir["#{File.dirname(__FILE__)}/**/*_test.rb"].each do |file|
|
|
||||||
define_method("test #{file}") do
|
|
||||||
command = "#{ruby} -Ilib:test #{file}"
|
|
||||||
result = silence_stderr { `#{command}` }
|
|
||||||
assert $?.to_i.zero?, "#{command}\n#{result}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue