diff options
author | Tim Emiola <temiola@google.com> | 2015-04-17 18:12:32 -0700 |
---|---|---|
committer | Tim Emiola <temiola@google.com> | 2015-04-17 18:12:32 -0700 |
commit | c85c1ae46330872f83f887eb521ff19967a6bc34 (patch) | |
tree | e2fb470ae1aef93ce5b39d1bc4be96067b78402b /src | |
parent | 9bffc908a8c0002c66438b5fd831f4ceb9fa663f (diff) |
Add SimpleCov coverage set up for gRPC ruby
Diffstat (limited to 'src')
-rwxr-xr-x | src/ruby/.rspec | 1 | ||||
-rwxr-xr-x | src/ruby/Rakefile | 1 | ||||
-rwxr-xr-x | src/ruby/grpc.gemspec | 1 | ||||
-rw-r--r-- | src/ruby/spec/spec_helper.rb | 12 |
4 files changed, 11 insertions, 4 deletions
diff --git a/src/ruby/.rspec b/src/ruby/.rspec index 60a4aad5a2..dd579f7a13 100755 --- a/src/ruby/.rspec +++ b/src/ruby/.rspec @@ -1 +1,2 @@ -I. +--require spec_helper diff --git a/src/ruby/Rakefile b/src/ruby/Rakefile index afb354e922..02af9a84b8 100755 --- a/src/ruby/Rakefile +++ b/src/ruby/Rakefile @@ -26,6 +26,7 @@ namespace :suite do SPEC_SUITES.each do |suite| desc "Run all specs in the #{suite[:title]} spec suite" RSpec::Core::RakeTask.new(suite[:id]) do |t| + ENV['COVERAGE_NAME'] = suite[:id].to_s spec_files = [] suite[:files].each { |f| spec_files += Dir[f] } if suite[:files] diff --git a/src/ruby/grpc.gemspec b/src/ruby/grpc.gemspec index 12d4ab17f2..3e87a422c8 100755 --- a/src/ruby/grpc.gemspec +++ b/src/ruby/grpc.gemspec @@ -27,6 +27,7 @@ Gem::Specification.new do |s| s.add_dependency 'minitest', '~> 5.4' # reqd for interop tests s.add_dependency 'xray', '~> 1.1' + s.add_development_dependency 'simplecov', '~> 0.9' s.add_development_dependency 'bundler', '~> 1.9' s.add_development_dependency 'rake', '~> 10.4' s.add_development_dependency 'rake-compiler', '~> 0.9' diff --git a/src/ruby/spec/spec_helper.rb b/src/ruby/spec/spec_helper.rb index 837d2fc42a..101165c146 100644 --- a/src/ruby/spec/spec_helper.rb +++ b/src/ruby/spec/spec_helper.rb @@ -35,14 +35,18 @@ $LOAD_PATH.unshift(spec_dir) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! -require 'faraday' +# set up coverage +require 'simplecov' +SimpleCov.start do + add_filter 'spec' + add_filter 'bin' + SimpleCov.command_name ENV['COVERAGE_NAME'] +end if ENV['COVERAGE_NAME'] + require 'rspec' require 'logging' require 'rspec/logging_helper' -# Allow Faraday to support test stubs -Faraday::Adapter.load_middleware(:test) - # Configure RSpec to capture log messages for each test. The output from the # logs will be stored in the @log_output variable. It is a StringIO instance. RSpec.configure do |config| |