aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r--railties/test/generators_test.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index dd17f8f756..16f8f43b99 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -1,6 +1,6 @@
require 'generators/generators_test_helper'
-require 'generators/rails/model/model_generator'
-require 'generators/test_unit/model/model_generator'
+require 'rails/generators/rails/model/model_generator'
+require 'rails/generators/test_unit/model/model_generator'
require 'mocha'
class GeneratorsTest < Rails::Generators::TestCase
@@ -104,11 +104,25 @@ class GeneratorsTest < Rails::Generators::TestCase
def test_rails_generators_with_others_information
output = capture(:stdout){ Rails::Generators.help }
- assert_match /ActiveRecord:/, output
assert_match /Fixjour:/, output
+ assert_match /^ fixjour$/, output
+ end
+
+ def test_rails_generators_does_not_show_activerecord_info_if_its_the_default
+ output = capture(:stdout){ Rails::Generators.help }
+ assert_no_match /ActiveRecord:/, output
+ assert_no_match /^ active_record:model$/, output
+ assert_no_match /^ active_record:fixjour$/, output
+ end
+
+ def test_rails_generators_shows_activerecord_info_if_its_not_the_default
+ Rails::Generators.options[:rails][:orm] = :data_mapper
+ output = capture(:stdout){ Rails::Generators.help }
+ assert_match /ActiveRecord:/, output
assert_match /^ active_record:model$/, output
assert_match /^ active_record:fixjour$/, output
- assert_match /^ fixjour$/, output
+ ensure
+ Rails::Generators.options[:rails][:orm] = :active_record
end
def test_no_color_sets_proper_shell