Permalink
Browse files

Adding tests for gemspec file creation

  • Loading branch information...
1 parent b6675d8 commit e35d5200cb214d23458f56f1b87511c24e8a31bd @arunagw arunagw committed Jul 17, 2011
@@ -5,5 +5,8 @@ Gem::Specification.new do |s|
s.summary = "Insert <%= camelized %> summary."
s.description = "Insert <%= camelized %> description."
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
+<% unless options.skip_test_unit? -%>
+ s.test_files = Dir["test/**/*"]
+<% end -%>
s.version = "0.0.1"
-end
+end
@@ -195,6 +195,14 @@ def test_create_mountable_application_with_mountable_option
end
end
+ def test_creating_gemspec
+ run_generator
+ assert_file "bukkits.gemspec", /s.name = "bukkits"/
+ assert_file "bukkits.gemspec", /s.files = Dir\["\{app,config,db,lib\}\/\*\*\/\*"\]/
+ assert_file "bukkits.gemspec", /s.test_files = Dir\["test\/\*\*\/\*"\]/
+ assert_file "bukkits.gemspec", /s.version = "0.0.1"/
+ end
+
def test_passing_dummy_path_as_a_parameter
run_generator [destination_root, "--dummy_path", "spec/dummy"]
assert_file "spec/dummy"

0 comments on commit e35d520

Please sign in to comment.