Skip to content

Commit

Permalink
fix for rails app generator when using --pretend option
Browse files Browse the repository at this point in the history
[#5245 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
stve authored and spastorino committed Jul 30, 2010
1 parent d277b82 commit b823e50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -216,7 +216,7 @@ def create_root

empty_directory '.'
set_default_accessors!
FileUtils.cd(destination_root)
FileUtils.cd(destination_root) unless options[:pretend]
end

def create_root_files
Expand Down
6 changes: 6 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -58,6 +58,12 @@ def test_application_skeleton_is_created
DEFAULT_APP_FILES.each{ |path| assert_file path }
end

def test_application_generate_pretend
run_generator ["testapp", "--pretend"]

DEFAULT_APP_FILES.each{ |path| assert_no_file path }
end

def test_application_controller_and_layout_files
run_generator
assert_file "app/views/layouts/application.html.erb", /stylesheet_link_tag :all/
Expand Down

0 comments on commit b823e50

Please sign in to comment.