提交 5eaa30e4 编写于 作者: A Arun Agrawal

Running isolated tests

These stopped running don't know when. 
But these should be running now.
上级 e1026296
......@@ -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'
......
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,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|
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册