Permalink
Browse files

Added test for building gem to GitHub

  • Loading branch information...
1 parent 914e60c commit 28606c71a5e128379f92247770c74df90b4af7cf @logandk committed Jun 18, 2009
Showing with 22 additions and 4 deletions.
  1. +2 −2 Rakefile
  2. +2 −2 capistrano-ec2group.gemspec
  3. +18 −0 test/ec2group_test.rb
View
@@ -5,15 +5,15 @@ require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
-desc 'Test the sprockets_compressor plugin.'
+desc 'Test the capistrano-ec2group plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
-desc 'Generate documentation for the sprockets_compressor plugin.'
+desc 'Generate documentation for the capistrano-ec2group plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'capistrano-ec2group'
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "capistrano-ec2group"
- s.version = "1.0.0"
+ s.version = "1.0.1"
s.author = "Logan Raarup"
s.email = "logan@logan.dk"
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.has_rdoc = true
s.rdoc_options = ["--line-numbers", "--inline-source"]
- s.files = ["MIT-LICENSE", "Rakefile", "README.markdown", "lib/capistrano/ec2group.rb"]
+ s.files = ["MIT-LICENSE", "Rakefile", "README.markdown", "lib/capistrano/ec2group.rb", "test/ec2group_test.rb"]
s.require_paths = ["lib"]
s.add_dependency "capistrano", ">=2.1.0"
View
@@ -0,0 +1,18 @@
+require 'test/unit'
+require 'yaml'
+require 'rubygems/specification'
+
+class CapistranoTest < Test::Unit::TestCase
+ def test_build_gem
+ data = File.read(File.join(File.dirname(__FILE__), '..', 'capistrano-ec2group.gemspec'))
+ spec = nil
+
+ if data !~ %r{!ruby/object:Gem::Specification}
+ Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
+ else
+ spec = YAML.load(data)
+ end
+
+ assert spec.validate
+ end
+end

0 comments on commit 28606c7

Please sign in to comment.