diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-18 10:53:43 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-18 10:53:43 -0500 |
commit | 01e04a446c801af88a1bb0315efffc775a00eedf (patch) | |
tree | 4f1cbb75fe88a06572e96c269342153167af61ab | |
parent | f74e04c21d9930c863ef92639050c0434be8dd0c (diff) | |
download | rails-01e04a446c801af88a1bb0315efffc775a00eedf.tar.gz rails-01e04a446c801af88a1bb0315efffc775a00eedf.tar.bz2 rails-01e04a446c801af88a1bb0315efffc775a00eedf.zip |
Use Rails.root in railties tests
-rw-r--r-- | railties/test/generators/actions_test.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/generators_test.rb | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index adc61f6d8a..199b5fa8b4 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -89,7 +89,7 @@ class ActionsTest < GeneratorsTestCase def test_environment_should_include_data_in_environment_initializer_block run_generator - load_paths = 'config.load_paths += %w["#{RAILS_ROOT}/app/extras"]' + load_paths = 'config.load_paths += %w["#{Rails.root}/app/extras"]' action :environment, load_paths assert_file 'config/application.rb', /#{Regexp.escape(load_paths)}/ end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index e0b4e97952..3eefaf9b02 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -118,7 +118,7 @@ class AppGeneratorTest < GeneratorsTestCase end def test_template_from_dir_pwd - FileUtils.cd(RAILS_ROOT) + FileUtils.cd(Rails.root) assert_match /It works from file!/, run_generator(["-m", "lib/template.rb"]) end diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 2e19169d3d..178b5ef6de 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -80,7 +80,7 @@ class GeneratorsTest < GeneratorsTestCase Rails::Generators.instance_variable_set(:@load_paths, nil) spec = Gem::Specification.new - spec.expects(:full_gem_path).returns(File.join(RAILS_ROOT, 'vendor', 'another_gem_path', 'xspec')) + spec.expects(:full_gem_path).returns(File.join(Rails.root, 'vendor', 'another_gem_path', 'xspec')) Gem.expects(:respond_to?).with(:loaded_specs).returns(true) Gem.expects(:loaded_specs).returns(:spec => spec) @@ -119,7 +119,7 @@ class GeneratorsTest < GeneratorsTestCase end def test_rails_root_templates - template = File.join(RAILS_ROOT, "lib", "templates", "active_record", "model", "model.rb") + template = File.join(Rails.root, "lib", "templates", "active_record", "model", "model.rb") # Create template mkdir_p(File.dirname(template)) @@ -171,6 +171,6 @@ class GeneratorsTest < GeneratorsTestCase def test_source_paths_for_not_namespaced_generators mspec = Rails::Generators.find_by_namespace :mspec - assert mspec.source_paths.include?(File.join(RAILS_ROOT, "lib", "templates", "mspec")) + assert mspec.source_paths.include?(File.join(Rails.root, "lib", "templates", "mspec")) end end |