Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge abstract_controller/test_helper and new_base/test_helper since …

…they are expected to run in the same testing sandbox
  • Loading branch information...
commit 6d214c953b74c40d6247dfd2d4526991a0f99f5c 1 parent 199a423
@josh josh authored
Showing with 49 additions and 100 deletions.
  1. +4 −27 actionpack/Rakefile
  2. +1 −1  actionpack/test/abstract_controller/abstract_controller_test.rb
  3. +2 −2 actionpack/test/abstract_controller/callbacks_test.rb
  4. +1 −1  actionpack/test/abstract_controller/helper_test.rb
  5. +1 −1  actionpack/test/abstract_controller/layouts_test.rb
  6. +0 −24 actionpack/test/abstract_controller/test_helper.rb
  7. +8 −2 actionpack/test/{new_base/test_helper.rb → abstract_unit2.rb}
  8. +3 −3 actionpack/test/{lib → }/active_record_unit.rb
  9. +2 −2 actionpack/test/new_base/base_test.rb
  10. +2 −2 actionpack/test/new_base/content_negotiation_test.rb
  11. +1 −1  actionpack/test/new_base/content_type_test.rb
  12. +2 −2 actionpack/test/new_base/etag_test.rb
  13. +1 −2  actionpack/test/new_base/metal_test.rb
  14. +1 −1  actionpack/test/new_base/middleware_test.rb
  15. +0 −1  actionpack/test/new_base/redirect_test.rb
  16. +2 −2 actionpack/test/new_base/render_action_test.rb
  17. +2 −2 actionpack/test/new_base/render_file_test.rb
  18. +2 −2 actionpack/test/new_base/render_implicit_action_test.rb
  19. +2 −2 actionpack/test/new_base/render_layout_test.rb
  20. +2 −2 actionpack/test/new_base/render_partial_test.rb
  21. +2 −2 actionpack/test/new_base/render_rjs_test.rb
  22. +2 −2 actionpack/test/new_base/render_template_test.rb
  23. +2 −2 actionpack/test/new_base/render_test.rb
  24. +2 −2 actionpack/test/new_base/render_text_test.rb
  25. +2 −2 actionpack/test/new_base/render_xml_test.rb
  26. +0 −8 actionpack/test/runner
View
31 actionpack/Rakefile
@@ -34,11 +34,8 @@ end
desc "Run all unit tests"
task :test => [:test_action_pack, :test_active_record_integration, :test_new_base]
-test_lib_dirs = ENV["NEW"] ? ["test/new_base"] : []
-test_lib_dirs.push "test", "test/lib"
-# test_lib_dirs = [ENV["NEW"] ? "test/new_base" : "test", "test/lib"]
Rake::TestTask.new(:test_action_pack) do |t|
- t.libs.concat test_lib_dirs
+ t.libs << 'test'
# make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error
@@ -51,44 +48,24 @@ end
task :isolated_test do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
Dir.glob("test/{controller,dispatch,template}/**/*_test.rb").all? do |file|
- system(ruby, "-Ilib:#{test_lib_dirs * ':'}", file)
+ system(ruby, "-Itest", file)
end or raise "Failures"
end
desc 'ActiveRecord Integration Tests'
Rake::TestTask.new(:test_active_record_integration) do |t|
- t.libs.concat test_lib_dirs
+ t.libs << 'test'
t.test_files = Dir.glob("test/activerecord/*_test.rb")
t.verbose = true
end
desc 'New Controller Tests'
Rake::TestTask.new(:test_new_base) do |t|
- t.libs << "test/new_base" << "test/lib"
+ t.libs << 'test'
t.test_files = Dir.glob("test/{abstract_controller,new_base}/*_test.rb")
t.verbose = true
end
-desc 'Old Controller Tests on New Base'
-Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
- t.libs << "test/new_base" << "test/lib"
-
- t.verbose = true
- # ==== Not ported
- # * filters
-
- t.test_files = Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort + %w(
- action_pack_assertions addresses_render assert_select
- base benchmark caching capture content_type cookie dispatcher
- filter_params flash helper http_basic_authentication
- http_digest_authentication integration layout logging mime_responds
- record_identifier redirect render render_js render_json
- render_other render_xml request_forgery_protection rescue
- resources routing selector send_file test url_rewriter
- verification view_paths webservice
- ).map { |name| "test/controller/#{name}_test.rb" }
-end
-
# Genereate the RDoc documentation
Rake::RDocTask.new { |rdoc|
View
2  actionpack/test/abstract_controller/abstract_controller_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module AbstractController
module Testing
View
4 actionpack/test/abstract_controller/callbacks_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module AbstractController
module Testing
@@ -235,4 +235,4 @@ class TestHalting < ActiveSupport::TestCase
end
end
-end
+end
View
2  actionpack/test/abstract_controller/helper_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module AbstractController
module Testing
View
2  actionpack/test/abstract_controller/layouts_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
require 'active_support/core_ext/class/removal'
module AbstractControllerTests
View
24 actionpack/test/abstract_controller/test_helper.rb
@@ -1,24 +0,0 @@
-$:.unshift(File.dirname(__FILE__) + '/../../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-
-bundler = File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'gems', 'environment')
-require bundler if File.exist?("#{bundler}.rb")
-
-require 'rubygems'
-require 'test/unit'
-require 'active_support'
-require 'active_support/test_case'
-require 'abstract_controller'
-require 'action_view'
-require 'action_view/base'
-require 'action_dispatch'
-require 'fixture_template'
-
-begin
- require 'ruby-debug'
- Debugger.settings[:autoeval] = true
- Debugger.start
-rescue LoadError
- # Debugging disabled. `gem install ruby-debug` to enable.
-end
View
10 actionpack/test/new_base/test_helper.rb → actionpack/test/abstract_unit2.rb
@@ -1,6 +1,9 @@
-$:.unshift(File.dirname(__FILE__) + '/../../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
+# TODO: Unify with abstract_unit
+
+$:.unshift(File.dirname(__FILE__) + '/../lib')
+$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
$:.unshift(File.dirname(__FILE__) + '/../lib')
+$:.unshift(File.dirname(__FILE__) + '/lib')
bundler = File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'gems', 'environment')
require bundler if File.exist?("#{bundler}.rb")
@@ -8,7 +11,10 @@
require 'test/unit'
require 'active_support'
require 'active_support/test_case'
+require 'abstract_controller'
require 'action_view'
+require 'action_view/base'
+require 'action_dispatch'
require 'fixture_template'
begin
View
6 actionpack/test/lib/active_record_unit.rb → actionpack/test/active_record_unit.rb
@@ -16,7 +16,7 @@ class ActiveRecordTestConnector
else
$stderr.print 'Attempting to load Active Record... '
begin
- PATH_TO_AR = "#{File.dirname(__FILE__)}/../../../activerecord/lib"
+ PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib"
raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR)
$LOAD_PATH.unshift PATH_TO_AR
require 'active_record'
@@ -72,13 +72,13 @@ def setup_connection
# Load actionpack sqlite tables
def load_schema
- File.read(File.dirname(__FILE__) + "/../fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
+ File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
ActiveRecord::Base.connection.execute(sql) unless sql.blank?
end
end
def require_fixture_models
- Dir.glob(File.dirname(__FILE__) + "/../fixtures/*.rb").each {|f| require f}
+ Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f}
end
end
end
View
4 actionpack/test/new_base/base_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
# Tests the controller dispatching happy path
module Dispatching
@@ -65,4 +65,4 @@ class BaseTest < SimpleRouteCase
assert_equal 'contained_empty', Submodule::ContainedEmptyController.controller_name
end
end
-end
+end
View
4 actionpack/test/new_base/content_negotiation_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module ContentNegotiation
@@ -15,4 +15,4 @@ class TestContentNegotiation < SimpleRouteCase
assert_body "Hello world */*!"
end
end
-end
+end
View
2  actionpack/test/new_base/content_type_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module ContentType
class BaseController < ActionController::Base
View
4 actionpack/test/new_base/etag_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module Etags
class BasicController < ActionController::Base
@@ -43,4 +43,4 @@ def etag_for(text)
%("#{Digest::MD5.hexdigest(text)}")
end
end
-end
+end
View
3  actionpack/test/new_base/metal_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module MetalTest
class MetalMiddleware < ActionController::Middleware
@@ -41,4 +41,3 @@ def setup
end
end
end
-
View
2  actionpack/test/new_base/middleware_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module MiddlewareTest
class MyMiddleware
View
1  actionpack/test/new_base/redirect_test.rb
@@ -1 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
View
4 actionpack/test/new_base/render_action_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderAction
# This has no layout and it works
@@ -317,4 +317,4 @@ class ControllerLayoutTest < SimpleRouteCase
assert_status 200
end
end
-end
+end
View
4 actionpack/test/new_base/render_file_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderFile
@@ -107,4 +107,4 @@ def teardown
end
end
-end
+end
View
4 actionpack/test/new_base/render_implicit_action_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderImplicitAction
class SimpleController < ::ApplicationController
@@ -25,4 +25,4 @@ class RenderImplicitActionTest < SimpleRouteCase
assert_status 200
end
end
-end
+end
View
4 actionpack/test/new_base/render_layout_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module ControllerLayouts
class ImplicitController < ::ApplicationController
@@ -98,4 +98,4 @@ class MismatchFormatTest < SimpleRouteCase
end
end
end
-end
+end
View
4 actionpack/test/new_base/render_partial_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderPartial
@@ -24,4 +24,4 @@ class TestPartial < SimpleRouteCase
end
end
-end
+end
View
4 actionpack/test/new_base/render_rjs_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderRjs
@@ -42,4 +42,4 @@ class TestBasic < SimpleRouteCase
end
end
-end
+end
View
4 actionpack/test/new_base/render_template_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderTemplate
class WithoutLayoutController < ActionController::Base
@@ -167,4 +167,4 @@ class TestTemplateRenderWithForwardSlash < SimpleRouteCase
end
end
end
-end
+end
View
4 actionpack/test/new_base/render_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module Render
class BlankRenderController < ActionController::Base
@@ -82,4 +82,4 @@ class TestVariousObjectsAvailableInView < SimpleRouteCase
assert_body "Controller Name: blank_render"
end
end
-end
+end
View
4 actionpack/test/new_base/render_text_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderText
class SimpleController < ActionController::Base
@@ -134,4 +134,4 @@ class RenderTextTest < SimpleRouteCase
assert_status 200
end
end
-end
+end
View
4 actionpack/test/new_base/render_xml_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+require 'abstract_unit2'
module RenderXml
@@ -8,4 +8,4 @@ class BasicController < ActionController::Base
"render_xml/basic/with_render_erb" => "Hello world!"
)]
end
-end
+end
View
8 actionpack/test/runner
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-
-
-ARGV.each do |arg|
- Dir["#{Dir.pwd}/#{arg}/**/*_test.rb"].each do |file|
- require file
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.