mirror of https://github.com/rails/rails
Have all the tests running off a single Gemfile
This commit is contained in:
parent
a5c82a9dfb
commit
4f6d6f7031
|
@ -27,10 +27,6 @@ railties/guides/output
|
||||||
*.rbc
|
*.rbc
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
actionpack/bin
|
bin
|
||||||
activerecord/bin
|
|
||||||
vendor/gems/
|
vendor/gems/
|
||||||
*/vendor/gems/
|
|
||||||
railties/tmp
|
railties/tmp
|
||||||
activerecord/vendor
|
|
||||||
actionpack/vendor
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
Gem.sources.each { |uri| source uri }
|
||||||
|
|
||||||
|
gem "rails", "3.0.pre", :vendored_at => "railties"
|
||||||
|
%w(
|
||||||
|
activesupport
|
||||||
|
activemodel
|
||||||
|
actionpack
|
||||||
|
actionmailer
|
||||||
|
activerecord
|
||||||
|
activeresource
|
||||||
|
).each do |lib|
|
||||||
|
gem lib, '3.0.pre', :vendored_at => lib
|
||||||
|
end
|
||||||
|
gem "rack", "1.0.1"
|
||||||
|
gem "rack-mount", :git => "git://github.com/josh/rack-mount.git"
|
||||||
|
gem "rack-test", "~> 0.5.0"
|
||||||
|
gem "erubis", "~> 2.6.0"
|
||||||
|
gem "arel", :git => "git://github.com/rails/arel.git"
|
||||||
|
gem "mocha"
|
||||||
|
gem "sqlite3-ruby"
|
||||||
|
gem "RedCloth"
|
|
@ -1,10 +0,0 @@
|
||||||
Gem.sources.each { |uri| source uri }
|
|
||||||
sibling = "#{File.dirname(__FILE__)}/.."
|
|
||||||
|
|
||||||
gem "activesupport", "3.0.pre", :vendored_at => "#{sibling}/activesupport"
|
|
||||||
gem "activemodel", "3.0.pre", :vendored_at => "#{sibling}/activemodel"
|
|
||||||
gem "actionpack", "3.0.pre", :vendored_at => "#{sibling}/actionpack"
|
|
||||||
gem "rack-mount", :git => "git://github.com/josh/rack-mount.git"
|
|
||||||
gem "mocha"
|
|
||||||
|
|
||||||
#disable_system_gems
|
|
|
@ -1,15 +1,15 @@
|
||||||
bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment"
|
root = File.expand_path('../../..', __FILE__)
|
||||||
if File.exist?("#{bundled}.rb")
|
begin
|
||||||
require bundled
|
require "#{root}/vendor/gems/environment"
|
||||||
else
|
rescue LoadError
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
$:.unshift("#{root}/activesupport/lib")
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
|
$:.unshift("#{root}/actionpack/lib")
|
||||||
|
$:.unshift("#{root}/actionmailer/lib")
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
|
||||||
require 'action_mailer'
|
require 'action_mailer'
|
||||||
require 'action_mailer/test_case'
|
require 'action_mailer/test_case'
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
rails_root = Pathname.new(File.dirname(__FILE__)).join("..")
|
|
||||||
|
|
||||||
Gem.sources.each { |uri| source uri }
|
|
||||||
|
|
||||||
gem "rack", "1.0.1", :git => "git://github.com/rails/rack.git", :branch => "rack-1.0"
|
|
||||||
gem "rack-mount", :git => "git://github.com/josh/rack-mount.git"
|
|
||||||
gem "rack-test", "~> 0.5.0"
|
|
||||||
gem "activesupport", "3.0.pre", :vendored_at => rails_root.join("activesupport")
|
|
||||||
gem "activemodel", "3.0.pre", :vendored_at => rails_root.join("activemodel")
|
|
||||||
gem "arel", :git => "git://github.com/rails/arel.git"
|
|
||||||
gem "activerecord", "3.0.pre", :vendored_at => rails_root.join("activerecord")
|
|
||||||
gem "erubis", "~> 2.6.0"
|
|
||||||
|
|
||||||
gem "mocha"
|
|
||||||
gem "sqlite3-ruby"
|
|
||||||
gem "RedCloth"
|
|
||||||
|
|
||||||
disable_system_gems
|
|
|
@ -1,13 +1,12 @@
|
||||||
bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment"
|
root = File.expand_path('../../..', __FILE__)
|
||||||
if File.exist?("#{bundled}.rb")
|
begin
|
||||||
require bundled
|
require "#{root}/vendor/gems/environment"
|
||||||
else
|
rescue LoadError
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
$:.unshift "#{root}/activesupport/lib"
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../activemodel/lib"
|
$:.unshift "#{root}/activemodel/lib"
|
||||||
|
$:.unshift "#{root}/lib"
|
||||||
end
|
end
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__) + '/lib')
|
$:.unshift(File.dirname(__FILE__) + '/lib')
|
||||||
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
|
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
|
||||||
$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
|
$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
rails_root = Pathname.new(File.dirname(__FILE__)).join("..")
|
|
||||||
|
|
||||||
Gem.sources.each { |uri| source uri }
|
|
||||||
|
|
||||||
gem "activesupport", "3.0.pre", :vendored_at => rails_root.join("activesupport")
|
|
||||||
gem "arel", :git => "git://github.com/rails/arel.git"
|
|
||||||
|
|
||||||
only :test do
|
|
||||||
gem "sqlite3-ruby"
|
|
||||||
end
|
|
||||||
|
|
||||||
disable_system_gems
|
|
|
@ -1,13 +1,12 @@
|
||||||
bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment"
|
root = File.expand_path('../../../..', __FILE__)
|
||||||
if File.exist?("#{bundled}.rb")
|
begin
|
||||||
require bundled
|
require "#{root}/vendor/gems/environment"
|
||||||
else
|
rescue LoadError
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
$:.unshift("#{root}/activesupport/lib")
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
|
$:.unshift("#{root}/activemodel/lib")
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'config'
|
require 'config'
|
||||||
|
|
||||||
require 'active_model'
|
require 'active_model'
|
||||||
|
|
||||||
# Show backtraces for deprecated behavior for quicker cleanup.
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
Gem.sources.each { |uri| source uri }
|
|
||||||
sibling = "#{File.dirname(__FILE__)}/.."
|
|
||||||
|
|
||||||
gem "activesupport", "3.0.pre", :vendored_at => "#{sibling}/activesupport"
|
|
||||||
gem "activemodel", "3.0.pre", :vendored_at => "#{sibling}/activemodel"
|
|
||||||
gem "arel", :git => "git://github.com/rails/arel.git"
|
|
||||||
|
|
||||||
gem "mocha"
|
|
|
@ -1,10 +1,9 @@
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
root = File.expand_path('../../../..', __FILE__)
|
||||||
|
begin
|
||||||
bundled = "#{File.dirname(__FILE__)}/../../vendor/gems/environment"
|
require "#{root}/vendor/gems/environment"
|
||||||
if File.exist?("#{bundled}.rb")
|
rescue LoadError
|
||||||
require bundled
|
$:.unshift("#{root}/activesupport/lib")
|
||||||
else
|
$:.unshift("#{root}/activerecord/lib")
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'config'
|
require 'config'
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
|
root = File.expand_path('../../..', __FILE__)
|
||||||
|
begin
|
||||||
|
require "#{root}/vendor/gems/environment"
|
||||||
|
rescue LoadError
|
||||||
|
$:.unshift("#{root}/activesupport/lib")
|
||||||
|
$:.unshift("#{root}/activeresource/lib")
|
||||||
|
end
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
require 'active_support/test_case'
|
require 'active_support/test_case'
|
||||||
|
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
|
||||||
require 'active_resource'
|
require 'active_resource'
|
||||||
|
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../test"
|
$:.unshift "#{File.dirname(__FILE__)}/../test"
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "active_support/core_ext/load_error"
|
|
||||||
|
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
module Testing
|
module Testing
|
||||||
class ProxyTestResult
|
class ProxyTestResult
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
def ActiveSupport.requirable?(file)
|
def ActiveSupport.requirable?(file)
|
||||||
$LOAD_PATH.any? { |p| Dir.glob("#{p}/#{file}.*").any? }
|
$LOAD_PATH.any? { |p| Dir.glob("#{p}/#{file}.*").any? }
|
||||||
end
|
end
|
||||||
|
@ -10,7 +12,8 @@ end
|
||||||
gem lib, "~> #{version}"
|
gem lib, "~> #{version}"
|
||||||
# Use the vendored lib if the gem's missing or we aren't using RubyGems.
|
# Use the vendored lib if the gem's missing or we aren't using RubyGems.
|
||||||
rescue LoadError, NoMethodError
|
rescue LoadError, NoMethodError
|
||||||
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib")
|
# There could be symlinks
|
||||||
|
$LOAD_PATH.unshift Pathname.new(__FILE__).dirname.join("vendor/#{lib}-#{version}/lib").realpath.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
ORIG_ARGV = ARGV.dup
|
ORIG_ARGV = ARGV.dup
|
||||||
|
root = File.expand_path('../../..', __FILE__)
|
||||||
|
begin
|
||||||
|
require "#{root}/vendor/gems/environment"
|
||||||
|
rescue LoadError
|
||||||
|
$:.unshift("#{root}/activesupport/lib")
|
||||||
|
$:.unshift("#{root}/activerecord/lib")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
|
@ -11,7 +19,6 @@ rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV['NO_RELOAD'] = '1'
|
ENV['NO_RELOAD'] = '1'
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
require 'active_support/test_case'
|
require 'active_support/test_case'
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
Gem.sources.each { |uri| source uri }
|
|
||||||
sibling = "#{File.dirname(__FILE__)}/.."
|
|
||||||
|
|
||||||
gem "mocha"
|
|
||||||
|
|
||||||
gem "arel", :git => "git://github.com/rails/arel.git"
|
|
||||||
gem "rack", "1.0.1", :git => "git://github.com/rails/rack.git", :branch => "rack-1.0"
|
|
||||||
gem "rack-mount", :git => "git://github.com/josh/rack-mount.git"
|
|
||||||
gem "rack-test", "~> 0.5.0"
|
|
||||||
|
|
||||||
%w(activesupport activemodel actionpack actionmailer activerecord activeresource).each do |lib|
|
|
||||||
gem lib, '3.0.pre', :vendored_at => "#{sibling}/#{lib}"
|
|
||||||
end
|
|
|
@ -1,16 +1,15 @@
|
||||||
ORIG_ARGV = ARGV.dup
|
ORIG_ARGV = ARGV.dup
|
||||||
|
|
||||||
bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment"
|
root = File.expand_path('../../..', __FILE__)
|
||||||
if File.exist?("#{bundled}.rb")
|
begin
|
||||||
require bundled
|
require "#{root}/vendor/gems/environment"
|
||||||
else
|
rescue LoadError
|
||||||
%w(activesupport activemodel activerecord actionpack actionmailer activeresource).each do |lib|
|
%w(activesupport activemodel activerecord actionpack actionmailer activeresource railties).each do |lib|
|
||||||
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../#{lib}/lib"
|
$:.unshift "#{root}/#{lib}/lib"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
$:.unshift File.dirname(__FILE__) + "/../lib"
|
$:.unshift "#{root}/railties/builtin/rails_info"
|
||||||
$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"
|
|
||||||
|
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
|
@ -82,26 +82,6 @@ module ApplicationTests
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "action_pack is added to the load path if action_controller is required" do
|
|
||||||
Rails::Initializer.run do |config|
|
|
||||||
config.root = app_path
|
|
||||||
config.frameworks = [:action_controller]
|
|
||||||
end
|
|
||||||
Rails.initialize!
|
|
||||||
|
|
||||||
assert $:.include?("#{framework_path}/actionpack/lib")
|
|
||||||
end
|
|
||||||
|
|
||||||
test "action_pack is added to the load path if action_view is required" do
|
|
||||||
Rails::Initializer.run do |config|
|
|
||||||
config.root = app_path
|
|
||||||
config.frameworks = [:action_view]
|
|
||||||
end
|
|
||||||
Rails.initialize!
|
|
||||||
|
|
||||||
assert $:.include?("#{framework_path}/actionpack/lib")
|
|
||||||
end
|
|
||||||
|
|
||||||
test "after_initialize block works correctly" do
|
test "after_initialize block works correctly" do
|
||||||
Rails::Initializer.run do |config|
|
Rails::Initializer.run do |config|
|
||||||
config.root = app_path
|
config.root = app_path
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#
|
#
|
||||||
# It is also good to know what is the bare minimum to get
|
# It is also good to know what is the bare minimum to get
|
||||||
# Rails booted up.
|
# Rails booted up.
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
|
|
||||||
# TODO: Remove rubygems when possible
|
# TODO: Remove rubygems when possible
|
||||||
|
@ -82,6 +81,7 @@ module TestHelpers
|
||||||
def build_app(options = {})
|
def build_app(options = {})
|
||||||
FileUtils.rm_rf(app_path)
|
FileUtils.rm_rf(app_path)
|
||||||
FileUtils.cp_r(tmp_path('app_template'), app_path)
|
FileUtils.cp_r(tmp_path('app_template'), app_path)
|
||||||
|
FileUtils.ln_s(RAILS_FRAMEWORK_ROOT, app_path('vendor/rails'))
|
||||||
|
|
||||||
# Delete the initializers unless requested
|
# Delete the initializers unless requested
|
||||||
unless options[:initializers]
|
unless options[:initializers]
|
||||||
|
@ -114,13 +114,10 @@ module TestHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def boot_rails
|
def boot_rails
|
||||||
bundled = "#{File.dirname(__FILE__)}/../../vendor/gems/environment"
|
root = File.expand_path('../../../..', __FILE__)
|
||||||
if File.exist?("#{bundled}.rb")
|
begin
|
||||||
require bundled
|
require "#{root}/vendor/gems/environment"
|
||||||
%w(railties railties/lib).each do |path|
|
rescue LoadError
|
||||||
$LOAD_PATH.unshift File.expand_path("../../../../#{path}", __FILE__)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
%w(
|
%w(
|
||||||
actionmailer/lib
|
actionmailer/lib
|
||||||
actionpack/lib
|
actionpack/lib
|
||||||
|
@ -131,8 +128,7 @@ module TestHelpers
|
||||||
railties/lib
|
railties/lib
|
||||||
railties
|
railties
|
||||||
).reverse_each do |path|
|
).reverse_each do |path|
|
||||||
path = File.expand_path("../../../../#{path}", __FILE__)
|
$:.unshift "#{root}/#{path}"
|
||||||
$:.unshift(path)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -155,5 +151,6 @@ Module.new do
|
||||||
end
|
end
|
||||||
|
|
||||||
FileUtils.mkdir(tmp_path)
|
FileUtils.mkdir(tmp_path)
|
||||||
`#{Gem.ruby} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails #{tmp_path('app_template')}`
|
root = File.expand_path('../../../..', __FILE__)
|
||||||
|
`#{Gem.ruby} -r #{root}/vendor/gems/environment #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails #{tmp_path('app_template')}`
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue