Skip to content

Commit

Permalink
Added test to ensure non zero exit codes when generating an applicati…
Browse files Browse the repository at this point in the history
…on with a reserved name.

Unfortunately, I can't find out how to suppress its output so we see ....Invalid application name test. Please give a name which does not match one of the reserved rails words.....................................
  • Loading branch information
parndt authored and josevalim committed Jan 29, 2011
1 parent d6fd582 commit 34fef7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ def test_invalid_application_name_is_fixed
assert_file "things-43/config/application.rb", /^module Things43$/
end

def test_application_new_exits_with_non_zero_code_on_failure
Dir.chdir(destination_root) do
`rails new test`
end
assert_equal false, $?.success?
end

def test_application_name_is_detected_if_it_exists_and_app_folder_renamed
app_root = File.join(destination_root, "myapp")
app_moved_root = File.join(destination_root, "myapp_moved")
Expand Down

0 comments on commit 34fef7e

Please sign in to comment.