diff --git a/.gitignore b/.gitignore index 80edba87..c48d5228 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ ToDo.md spec/params_entity_spec.rb vendor/bundle/ spec/swagger_v2/x-dummy.rb +coverage/ diff --git a/Gemfile b/Gemfile index a8dc96a9..e47fb6ec 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ group :development, :test do gem 'rubocop', '~> 0.40' end group :test do + gem 'coveralls', require: false gem 'grape-entity' gem 'grape-swagger-entity' gem 'ruby-grape-danger', '~> 0.1.1', require: false diff --git a/README.md b/README.md index 91742d3b..55b106b0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Gem Version](https://badge.fury.io/rb/grape-swagger.svg)](http://badge.fury.io/rb/grape-swagger) [![Build Status](https://travis-ci.org/ruby-grape/grape-swagger.svg?branch=master)](https://travis-ci.org/ruby-grape/grape-swagger) +[![Coverage Status](https://coveralls.io/repos/github/ruby-grape/grape-swagger/badge.svg)](https://coveralls.io/github/ruby-grape/grape-swagger) [![Dependency Status](https://gemnasium.com/ruby-grape/grape-swagger.svg)](https://gemnasium.com/ruby-grape/grape-swagger) [![Code Climate](https://codeclimate.com/github/ruby-grape/grape-swagger.svg)](https://codeclimate.com/github/ruby-grape/grape-swagger) diff --git a/coveralls.yml b/coveralls.yml new file mode 100644 index 00000000..91600595 --- /dev/null +++ b/coveralls.yml @@ -0,0 +1 @@ +service_name: travis-ci diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index be1acabb..8b7e0be3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,13 @@ +require 'coveralls' +Coveralls.wear! + $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) MODEL_PARSER = ENV.key?('MODEL_PARSER') ? ENV['MODEL_PARSER'].to_s.downcase.sub('grape-swagger-', '') : 'mock' require 'grape' require 'grape-swagger' + Dir[File.join(Dir.getwd, 'spec/support/*.rb')].each { |f| require f } require "grape-swagger/#{MODEL_PARSER}" if MODEL_PARSER != 'mock' require File.join(Dir.getwd, "spec/support/model_parsers/#{MODEL_PARSER}_parser.rb")