Permalink
Browse files

railties tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0c999f4 commit 4c7345305aee09df6b3e1e5f3139880875c9ebd5 @jeremy jeremy committed Sep 3, 2006
@@ -26,7 +26,11 @@ class InstanceTag; end
# Must set before requiring generator libs.
-RAILS_ROOT = "#{File.dirname(__FILE__)}/fixtures"
+if defined?(RAILS_ROOT)
+ RAILS_ROOT.replace "#{File.dirname(__FILE__)}/fixtures"
+else
+ RAILS_ROOT = "#{File.dirname(__FILE__)}/fixtures"
+end
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
require 'rails_generator'
@@ -88,7 +92,7 @@ def test_generator_spec
assert_equal 'working', spec.name
assert_equal "#{RAILS_ROOT}/lib/generators/working", spec.path
assert_equal :lib, spec.source
- assert_nothing_raised { assert_match /WorkingGenerator$/, spec.klass.name }
+ assert_nothing_raised { assert_match(/WorkingGenerator$/, spec.klass.name) }
end
def test_named_generator_attributes
@@ -1,15 +1,11 @@
-$:.unshift File.dirname(__FILE__) + "/../lib"
-$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"
-$:.unshift File.dirname(__FILE__) + "/../../actionpack/lib"
-$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
-
-require 'test/unit'
+require "#{File.dirname(__FILE__)}/abstract_unit"
require 'action_controller'
require 'action_controller/test_process'
module Rails; end
-require_dependency 'rails/info'
-require_dependency 'rails/info_controller'
+require 'rails/info'
+require 'rails/info_controller'
+
class Rails::InfoController < ActionController::Base
@local_request = false
class << self
@@ -5,8 +5,10 @@
require 'test/unit'
require 'active_support'
-module Rails
- class Info; end
+unless defined?(Rails) && defined?(Rails::Info)
+ module Rails
+ class Info; end
+ end
end
class InfoTest < Test::Unit::TestCase

0 comments on commit 4c73453

Please sign in to comment.