diff --git a/.gitignore b/.gitignore index 6c9ec7593..dff6ab0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ .ruby-version .rvmrc .yardoc -coverage/ doc/ Gemfile.lock gemfiles/*.lock diff --git a/audited.gemspec b/audited.gemspec index f88578174..6d2eccf8a 100644 --- a/audited.gemspec +++ b/audited.gemspec @@ -22,6 +22,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'appraisal' gem.add_development_dependency 'rails', '>= 4.2', '< 5.2' gem.add_development_dependency 'rspec-rails', '~> 3.5' + gem.add_development_dependency 'single_cov' # JRuby support for the test ENV if defined?(JRUBY_VERSION) diff --git a/spec/audited/audit_spec.rb b/spec/audited/audit_spec.rb index 3260072eb..9f59818f1 100644 --- a/spec/audited/audit_spec.rb +++ b/spec/audited/audit_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! uncovered: 6 # not testing json object and collection_cache_key + describe Audited::Audit do let(:user) { Models::ActiveRecord::User.new name: "Testing" } diff --git a/spec/audited/auditor_spec.rb b/spec/audited/auditor_spec.rb index 174dbe683..10e8fb533 100644 --- a/spec/audited/auditor_spec.rb +++ b/spec/audited/auditor_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! uncovered: 9 # not testing proxy_respond_to? hack / 2 methods + describe Audited::Auditor do describe "configuration" do diff --git a/spec/audited/sweeper_spec.rb b/spec/audited/sweeper_spec.rb index 07093fb40..48cae7eba 100644 --- a/spec/audited/sweeper_spec.rb +++ b/spec/audited/sweeper_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! uncovered: 3 + class AuditsController < ActionController::Base before_action :populate_user diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1818d25e2..9b1993f0d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,8 @@ ENV['RAILS_ENV'] = 'test' +require 'bundler/setup' +require 'single_cov' +SingleCov.setup :rspec -require 'bundler' if Bundler.definition.dependencies.map(&:name).include?('protected_attributes') require 'protected_attributes' end