Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move coverage dependencies to the gemspec because they depend on plat…

…forms and add rake tasks for both
  • Loading branch information...
commit cbb6eebc710527ebca8a31c98ff5a96c41eb5392 1 parent 8702a91
@alexcrichton alexcrichton authored
View
1  .gitignore
@@ -1,3 +1,4 @@
pkg/*
*.gem
.bundle
+coverage
View
5 Gemfile
@@ -1,3 +1,8 @@
source :rubygems
gemspec
+
+group :development do
+ gem 'rcov', :platform => :ruby_18
+ gem 'simplecov', :platform => :ruby_19
+end
View
4 Gemfile.lock
@@ -56,6 +56,9 @@ GEM
rspec-expectations (2.1.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.1.0)
+ simplecov (0.3.7)
+ simplecov-html (>= 0.3.7)
+ simplecov-html (0.3.9)
sqlite3-ruby (1.3.2)
thor (0.14.6)
tzinfo (0.3.23)
@@ -69,5 +72,6 @@ DEPENDENCIES
railties (>= 3.0.0)
rcov
rspec
+ simplecov
sqlite3-ruby
vestal_versions!
View
35 Rakefile
@@ -1,2 +1,37 @@
require 'bundler'
+require 'rspec/core/rake_task'
+
Bundler::GemHelper.install_tasks
+RSpec::Core::RakeTask.new(:spec)
+
+if RUBY_VERSION < '1.9'
+ desc "Run all tests with coverage"
+ RSpec::Core::RakeTask.new :coverage => :cleanup_coverage_files do |t|
+ t.rcov = true
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,spec/support,spec/paste,spec/spec_helper.rb"]
+ end
+else
+ desc 'Run all tests with coverage'
+ task :coverage => :cleanup_coverage_files do
+ require 'simplecov'
+
+ SimpleCov.start do
+ add_filter '/spec/'
+
+ require 'rspec/core'
+ spec_dir = File.expand_path('../spec', __FILE__)
+ RSpec::Core::Runner.disable_autorun!
+ RSpec::Core::Runner.run [spec_dir], STDERR, STDOUT
+ end
+
+ end
+end
+
+task :cleanup_coverage_files do
+ rm_rf 'coverage*'
+end
+
+task :clobber => :cleanup_rcov_files do
+ rm_rf 'pkg'
+ rm_rf 'tmp'
+end
View
1  vestal_versions.gemspec
@@ -21,6 +21,5 @@ Gem::Specification.new do |s|
s.add_dependency 'railties', '>= 3.0.0'
s.add_development_dependency 'rspec'
- s.add_development_dependency 'rcov'
s.add_development_dependency 'sqlite3-ruby'
end

0 comments on commit cbb6eeb

Please sign in to comment.
Something went wrong with that request. Please try again.