aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/app_generator_test.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-30 11:17:58 -0700
committerwycats <wycats@gmail.com>2010-04-30 11:17:58 -0700
commit0fe8827bf384cb99ab757236555c7af18793d515 (patch)
treea7ac2143c78964cad8ee87d9ff8a1c52abf61249 /railties/test/generators/app_generator_test.rb
parent91963e9e33eb5a28297323f1346aeb8b643e9d65 (diff)
parent6b559474fb7fae0160860fc62752da347af032b2 (diff)
downloadrails-0fe8827bf384cb99ab757236555c7af18793d515.tar.gz
rails-0fe8827bf384cb99ab757236555c7af18793d515.tar.bz2
rails-0fe8827bf384cb99ab757236555c7af18793d515.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r--railties/test/generators/app_generator_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 24e6d541c2..2e402c4f3a 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -58,6 +58,11 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_no_file "public/stylesheets/application.css"
end
+ def test_options_before_application_name_raises_an_error
+ content = capture(:stderr){ run_generator(["--skip-activerecord", destination_root]) }
+ assert_equal "Options should be given after the application name. For details run: rails --help\n", content
+ end
+
def test_name_collision_raises_an_error
content = capture(:stderr){ run_generator [File.join(destination_root, "generate")] }
assert_equal "Invalid application name generate. Please give a name which does not match one of the reserved rails words.\n", content
@@ -152,7 +157,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
template = %{ say "It works!" }
template.instance_eval "def read; self; end" # Make the string respond to read
- generator([destination_root], :template => path).expects(:open).with(path).returns(template)
+ generator([destination_root], :template => path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template)
assert_match /It works!/, silence(:stdout){ generator.invoke }
end