Skip to content

Commit e42902a

Browse files
committed
Add SimpleCov and Coveralls.io dependenices
Add rake tasks for travis, which include publishing coverage reports.
1 parent 06deb85 commit e42902a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
source "https://rubygems.org"
22

3+
group :development, :test do
4+
# This is here because gemspec doesn't support require: false
5+
gem 'coveralls', :require => false
6+
end
7+
38
gemspec

Rakefile

+14
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ end
4747

4848
GEM_NAME = "#{name}"
4949
task :default => :test
50+
task :travis => ['test:travis', 'coveralls_push_workaround']
5051

5152
require "tasks/test_task"
5253
Fog::Rake::TestTask.new
5354

5455
namespace :test do
56+
task :travis do
57+
[true].each do |mock|
58+
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
59+
end
60+
end
5561
task :vsphere do
5662
[true].each do |mock|
5763
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
@@ -186,3 +192,11 @@ end
186192

187193
require "tasks/changelog_task"
188194
Fog::Rake::ChangelogTask.new
195+
196+
task :coveralls_push_workaround do
197+
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
198+
require 'coveralls/rake/task'
199+
Coveralls::RakeTask.new
200+
Rake::Task["coveralls:push"].invoke
201+
end
202+
end

0 commit comments

Comments
 (0)