2004-11-23 20:04:44 -05:00
|
|
|
require 'rake/testtask'
|
2011-05-24 14:08:11 -04:00
|
|
|
require 'rubygems/package_task'
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2007-09-25 21:24:07 -04:00
|
|
|
task :default => :test
|
2013-01-01 05:03:40 -05:00
|
|
|
|
|
|
|
desc "Run all unit tests"
|
2009-11-10 19:50:15 -05:00
|
|
|
task :test => 'test:isolated'
|
2007-09-25 21:24:07 -04:00
|
|
|
|
2009-11-10 19:50:15 -05:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
2013-04-08 06:16:33 -04:00
|
|
|
dirs = (ENV["TEST_DIR"] || ENV["TEST_DIRS"] || "**").split(",")
|
|
|
|
test_files = dirs.map { |dir| "test/#{dir}/*_test.rb" }
|
|
|
|
Dir[*test_files].each do |file|
|
2009-11-10 19:50:15 -05:00
|
|
|
next true if file.include?("fixtures")
|
2011-09-09 22:00:33 -04:00
|
|
|
dash_i = [
|
|
|
|
'test',
|
|
|
|
'lib',
|
|
|
|
"#{File.dirname(__FILE__)}/../activesupport/lib",
|
2012-05-11 12:56:05 -04:00
|
|
|
"#{File.dirname(__FILE__)}/../actionpack/lib",
|
|
|
|
"#{File.dirname(__FILE__)}/../activemodel/lib"
|
2011-09-09 22:00:33 -04:00
|
|
|
]
|
2011-11-28 05:58:07 -05:00
|
|
|
ruby "-w", "-I#{dash_i.join ':'}", file
|
2010-06-24 04:56:16 -04:00
|
|
|
end
|
2009-11-10 19:50:15 -05:00
|
|
|
end
|
2006-11-01 22:34:03 -05:00
|
|
|
end
|
|
|
|
|
2009-11-10 19:50:15 -05:00
|
|
|
Rake::TestTask.new('test:regular') do |t|
|
2009-04-22 19:10:49 -04:00
|
|
|
t.libs << 'test' << "#{File.dirname(__FILE__)}/../activesupport/lib"
|
2006-08-29 05:15:28 -04:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
|
|
|
t.warning = true
|
|
|
|
t.verbose = true
|
|
|
|
end
|
2005-07-12 22:12:00 -04:00
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
# Generate GEM ----------------------------------------------------------------------------
|
|
|
|
|
2009-11-30 19:46:09 -05:00
|
|
|
spec = eval(File.read('railties.gemspec'))
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-05-24 14:08:11 -04:00
|
|
|
Gem::PackageTask.new(spec) do |pkg|
|
2006-09-15 05:56:52 -04:00
|
|
|
pkg.gem_spec = spec
|
2004-11-23 20:04:44 -05:00
|
|
|
end
|
|
|
|
|
2005-03-27 08:33:54 -05:00
|
|
|
# Publishing -------------------------------------------------------
|
2009-12-29 06:19:38 -05:00
|
|
|
|
2013-06-21 04:57:00 -04:00
|
|
|
desc "Release to rubygems"
|
2010-02-05 03:03:03 -05:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|