1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1897 from maxlinc/code_coverage

Code coverage
This commit is contained in:
Paul Thornthwaite 2013-06-24 06:28:21 -07:00
commit f525276936
4 changed files with 31 additions and 1 deletions

View file

@ -6,7 +6,7 @@ rvm:
- 1.9.3
- 2.0.0
script: FOG_MOCK=true bundle exec shindont
script: bundle exec rake travis
notifications:
email: false

View file

@ -1,3 +1,8 @@
source "https://rubygems.org"
group :development, :test do
# This is here because gemspec doesn't support require: false
gem 'coveralls', :require => false
end
gemspec

View file

@ -47,11 +47,17 @@ end
GEM_NAME = "#{name}"
task :default => :test
task :travis => ['test:travis', 'coveralls_push_workaround']
require "tasks/test_task"
Fog::Rake::TestTask.new
namespace :test do
task :travis do
[true].each do |mock|
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end
end
task :vsphere do
[true].each do |mock|
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
@ -186,3 +192,11 @@ end
require "tasks/changelog_task"
Fog::Rake::ChangelogTask.new
task :coveralls_push_workaround do
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task["coveralls:push"].invoke
end
end

View file

@ -1,3 +1,14 @@
require 'simplecov'
require 'coveralls'
SimpleCov.command_name "shindo:#{Process.pid.to_s}"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
SimpleCov.merge_timeout 3600
SimpleCov.start if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
ENV['FOG_RC'] = ENV['FOG_RC'] || File.expand_path('../.fog', __FILE__)
ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'