1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Running isolated tests

These stopped running don't know when. 
But these should be running now.
This commit is contained in:
Arun Agrawal 2013-05-28 19:59:55 +02:00
parent e10262962b
commit 5eaa30e47c
4 changed files with 13 additions and 37 deletions

View file

@ -22,11 +22,15 @@ Rake::TestTask.new(:test_action_pack) do |t|
end
namespace :test do
Rake::TestTask.new(:isolated) do |t|
t.libs << 'test'
t.pattern = 'test/ts_isolated.rb'
task :isolated do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
Dir.glob("test/{abstract,controller,dispatch,template}/**/*_test.rb").all? do |file|
sh(ruby, '-Ilib:test', file)
end or raise "Failures"
end
end
namespace :test do
Rake::TestTask.new(:template) do |t|
t.libs << 'test'
t.pattern = 'test/template/**/*.rb'

View file

@ -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

View file

@ -9,13 +9,16 @@ Rake::TestTask.new do |t|
t.verbose = true
end
namespace :test do
Rake::TestTask.new(:isolated) do |t|
t.pattern = 'test/ts_isolated.rb'
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'))
Gem::PackageTask.new(spec) do |p|

View file

@ -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