diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 26 | ||||
-rw-r--r-- | railties/test/generators/generator_test.rb | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index cbcfe48f71..bd8efcc6c7 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -156,6 +156,32 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_add_gemfile_entry + template = Tempfile.open 'my_template' + template.puts 'gemfile_entry "tenderlove"' + template.flush + + run_generator([destination_root, "-m", template.path]) + assert_file "Gemfile", /tenderlove/ + ensure + template.close + template.unlink + end + + def test_add_skip_entry + template = Tempfile.open 'my_template' + template.puts 'add_gem_entry_filter { |gem| gem.name != "jbuilder" }' + template.flush + + run_generator([destination_root, "-m", template.path]) + assert_file "Gemfile" do |contents| + assert_no_match 'jbuilder', contents + end + ensure + template.close + template.unlink + end + def test_config_another_database run_generator([destination_root, "-d", "mysql"]) assert_file "config/database.yml", /mysql/ diff --git a/railties/test/generators/generator_test.rb b/railties/test/generators/generator_test.rb index 7871399dd7..94d2c1bf50 100644 --- a/railties/test/generators/generator_test.rb +++ b/railties/test/generators/generator_test.rb @@ -1,6 +1,7 @@ require 'active_support/test_case' require 'active_support/testing/autorun' require 'rails/generators/app_base' +require 'rails/generators/rails/app/app_generator' module Rails module Generators |