Skip to content

Commit

Permalink
Autoload AS test case
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jan 4, 2010
1 parent ce56c36 commit 2601a16
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 24 deletions.
3 changes: 0 additions & 3 deletions actionmailer/lib/action_mailer/test_case.rb
@@ -1,6 +1,3 @@
require 'active_support/test_case'
require 'action_mailer/base'

module ActionMailer
class NonInferrableMailerError < ::StandardError
def initialize(name)
Expand Down
1 change: 0 additions & 1 deletion actionpack/lib/action_controller/test_case.rb
@@ -1,4 +1,3 @@
require 'active_support/test_case'
require 'rack/session/abstract/id'

module ActionController
Expand Down
1 change: 0 additions & 1 deletion actionpack/lib/action_dispatch/testing/integration.rb
@@ -1,6 +1,5 @@
require 'stringio'
require 'uri'
require 'active_support/test_case'
require 'active_support/core_ext/object/metaclass'
require 'rack/test'

Expand Down
2 changes: 0 additions & 2 deletions actionpack/lib/action_view/test_case.rb
@@ -1,5 +1,3 @@
require 'active_support/test_case'

module ActionView
class Base
alias_method :initialize_without_template_tracking, :initialize
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/abstract_unit.rb
Expand Up @@ -19,7 +19,6 @@
require 'action_view/base'
require 'action_dispatch'
require 'fixture_template'
require 'active_support/test_case'
require 'active_support/dependencies'

activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
Expand Down
2 changes: 0 additions & 2 deletions activemodel/lib/active_model/test_case.rb
@@ -1,5 +1,3 @@
require "active_support/test_case"

module ActiveModel #:nodoc:
class TestCase < ActiveSupport::TestCase #:nodoc:
def with_kcode(kcode)
Expand Down
1 change: 0 additions & 1 deletion activerecord/lib/active_record/fixtures.rb
Expand Up @@ -3,7 +3,6 @@
require 'csv'
require 'zlib'
require 'active_support/dependencies'
require 'active_support/test_case'
require 'active_support/core_ext/logger'

if RUBY_VERSION < '1.9'
Expand Down
2 changes: 0 additions & 2 deletions activerecord/lib/active_record/test_case.rb
@@ -1,5 +1,3 @@
require "active_support/test_case"

module ActiveRecord
class TestCase < ActiveSupport::TestCase #:nodoc:
def assert_date_from_db(expected, actual, message = nil)
Expand Down
1 change: 0 additions & 1 deletion activeresource/test/abstract_unit.rb
Expand Up @@ -10,7 +10,6 @@
require 'test/unit'
require 'active_resource'
require 'active_support'
require 'active_support/test_case'
require 'active_model/test_case'

$:.unshift "#{File.dirname(__FILE__)}/../test"
Expand Down
2 changes: 2 additions & 0 deletions activesupport/lib/active_support.rb
Expand Up @@ -66,6 +66,8 @@ module ActiveSupport
autoload :StringInquirer
autoload :XmlMini
end

autoload :TestCase
end

require 'active_support/vendor'
1 change: 0 additions & 1 deletion activesupport/test/abstract_unit.rb
Expand Up @@ -13,7 +13,6 @@

ENV['NO_RELOAD'] = '1'
require 'active_support'
require 'active_support/test_case'

# Include shims until we get off 1.8.6
require 'active_support/ruby/shim'
Expand Down
1 change: 0 additions & 1 deletion railties/lib/rails/console_app.rb
@@ -1,5 +1,4 @@
require 'active_support/all'
require 'active_support/test_case'
require 'action_controller'

# work around the at_exit hook in test/unit, which kills IRB
Expand Down
9 changes: 4 additions & 5 deletions railties/lib/rails/generators/test_case.rb
@@ -1,4 +1,3 @@
require 'active_support/test_case'
require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/hash/reverse_merge'
require 'rails/generators'
Expand Down Expand Up @@ -76,7 +75,7 @@ def capture(stream)
eval "$#{stream} = StringIO.new"
yield
result = eval("$#{stream}").string
ensure
ensure
eval("$#{stream} = #{stream.upcase}")
end

Expand Down Expand Up @@ -137,9 +136,9 @@ def assert_no_file(relative)
#
# assert_migration "db/migrate/create_products.rb"
#
# This method manipulates the given path and tries to find any migration which
# This method manipulates the given path and tries to find any migration which
# matches the migration name. For example, the call above is converted to:
#
#
# assert_file "db/migrate/003_create_products.rb"
#
# Consequently, assert_migration accepts the same arguments has assert_file.
Expand Down Expand Up @@ -236,4 +235,4 @@ def migration_file_name(relative) #:nodoc:
end
end
end
end
end
@@ -1,5 +1,3 @@
require 'rubygems'
require 'test/unit'
require 'active_support'
require 'active_support/test_case'

1 change: 0 additions & 1 deletion railties/test/abstract_unit.rb
Expand Up @@ -17,7 +17,6 @@

require 'active_support'
require 'active_support/core_ext/logger'
require 'active_support/test_case'

require 'action_controller'
require 'rails/all'
Expand Down

0 comments on commit 2601a16

Please sign in to comment.