Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow to set dummy application path through options

  • Loading branch information...
commit cc135e3b6df1785852de2470b4b93559c88c891e 1 parent 1fd4624
@drogus authored
View
5 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -102,6 +102,9 @@ class PluginNewGenerator < AppBase
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 @@ def rakefile_test_tasks
def dummy_path(path = nil)
@dummy_path = path if path
- @dummy_path || "test/dummy"
+ @dummy_path || options[:dummy_path]
end
def mute(&block)
View
7 railties/test/generators/plugin_new_generator_test.rb
@@ -140,6 +140,13 @@ def test_create_mountable_application_with_mountable_option
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)
Please sign in to comment.
Something went wrong with that request. Please try again.