Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More changes for plugin_new_generator.

  • Loading branch information...
commit 777fcc5cfd539a5643c49fc8d942f37fefe688c9 1 parent e35d520
@arunagw arunagw authored
View
4 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -202,7 +202,7 @@ def create_test_files
end
def create_test_dummy_files
- return if options[:skip_test_unit]
+ return if options[:skip_test_unit] && options[:dummy_path] == 'test/dummy'
create_dummy_app
end
@@ -258,7 +258,7 @@ def valid_const?
elsif RESERVED_NAMES.include?(name)
raise Error, "Invalid plugin name #{name}. Please give a name which does not match one of the reserved rails words."
elsif Object.const_defined?(camelized)
- raise Error, "Invalid plugin name #{name}, constant #{camelized} is already in use. Please choose another application name."
+ raise Error, "Invalid plugin name #{name}, constant #{camelized} is already in use. Please choose another plugin name."
end
end
View
15 railties/test/generators/plugin_new_generator_test.rb
@@ -210,6 +210,21 @@ def test_passing_dummy_path_as_a_parameter
assert_no_file "test/dummy"
end
+ def test_creating_dummy_without_tests_but_with_dummy_path
+ run_generator [destination_root, "--dummy_path", "spec/dummy", "--skip-test-unit"]
+ assert_file "spec/dummy"
+ assert_file "spec/dummy/config/application.rb"
+ assert_no_file "test"
+ end
+
+ def test_skipping_test_unit
+ run_generator [destination_root, "--skip-test-unit"]
+ assert_no_file "test"
+ assert_file "bukkits.gemspec" do |contents|
+ assert_no_match /s.test_files = Dir\["test\/\*\*\/\*"\]/, contents
+ end
+ end
+
def test_skipping_gemspec
run_generator [destination_root, "--skip-gemspec"]
assert_no_file "bukkits.gemspec"
Please sign in to comment.
Something went wrong with that request. Please try again.