1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Allow to set dummy application path through options

This commit is contained in:
Piotr Sarnacki 2010-11-08 22:43:51 +01:00
parent 1fd46240a6
commit cc135e3b6d
2 changed files with 11 additions and 1 deletions

View file

@ -102,6 +102,9 @@ task :default => :test
alias_method :plugin_path, :app_path
class_option :dummy_path, :type => :string, :default => "test/dummy",
:desc => "Create dummy application at given path"
class_option :full, :type => :boolean, :default => false,
:desc => "Generate rails engine with integration tests"
@ -232,7 +235,7 @@ end
def dummy_path(path = nil)
@dummy_path = path if path
@dummy_path || "test/dummy"
@dummy_path || options[:dummy_path]
end
def mute(&block)

View file

@ -140,6 +140,13 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
assert_file "app/helpers/bukkits/application_helper.rb", /module Bukkits\n module ApplicationHelper/
end
def test_passing_dummy_path_as_a_parameter
run_generator [destination_root, "--dummy_path", "spec/dummy"]
assert_file "spec/dummy"
assert_file "spec/dummy/config/application.rb"
assert_no_file "test/dummy"
end
protected
def action(*args, &block)