Add SimpleCov coverage set up for gRPC ruby

pull/1313/head
Tim Emiola 10 years ago
parent 9bffc908a8
commit c85c1ae463
  1. 1
      src/ruby/.rspec
  2. 1
      src/ruby/Rakefile
  3. 1
      src/ruby/grpc.gemspec
  4. 12
      src/ruby/spec/spec_helper.rb

@ -1 +1,2 @@
-I.
--require spec_helper

@ -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]

@ -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'

@ -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|

Loading…
Cancel
Save