Skip to content

Commit

Permalink
Add test files to engine's gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Sprenger committed May 25, 2011
1 parent 41eac9b commit 5cf934e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -5,5 +5,8 @@ Gem::Specification.new do |s|
s.summary = "Insert <%= camelized %> summary."
s.description = "Insert <%= camelized %> description."
s.files = Dir["{app,config,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
<% unless options.skip_test_unit? -%>
s.test_files = Dir["test/**/*"]
<% end -%>
s.version = "0.0.1"
end
7 changes: 7 additions & 0 deletions railties/test/generators/plugin_new_generator_test.rb
Expand Up @@ -173,6 +173,7 @@ def test_creating_gemspec
run_generator
assert_file "bukkits.gemspec", /s.name = "bukkits"/
assert_file "bukkits.gemspec", /s.files = Dir\["\{app,config,lib\}\/\*\*\/\*"\]/
assert_file "bukkits.gemspec", /s.test_files = Dir\["test\/\*\*\/\*"\]/
assert_file "bukkits.gemspec", /s.version = "0.0.1"/
end

Expand All @@ -195,6 +196,12 @@ def test_creating_dummy_without_tests_but_with_dummy_path
assert_no_file "test"
end

def test_skipping_test_unit
run_generator [destination_root, "--skip-test-unit"]
assert_no_file "test"
assert_no_match(/s.test_files = Dir\["test\/\*\*\/\*"\]/, File.read(File.join(destination_root, "bukkits.gemspec")))
end

def test_skipping_gemspec
run_generator [destination_root, "--skip-gemspec"]
assert_no_file "bukkits.gemspec"
Expand Down

0 comments on commit 5cf934e

Please sign in to comment.