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 99527a8b6..e389a84b9 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.0', '< 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..cad7c35d4 100644 --- a/spec/audited/audit_spec.rb +++ b/spec/audited/audit_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! uncovered: 3 # 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 f6c4543d7..0f6357dfd 100644 --- a/spec/audited/auditor_spec.rb +++ b/spec/audited/auditor_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! uncovered: 1 # not testing proxy_respond_to? hack + describe Audited::Auditor do describe "configuration" do diff --git a/spec/audited/sweeper_spec.rb b/spec/audited/sweeper_spec.rb index 07093fb40..7d6898e75 100644 --- a/spec/audited/sweeper_spec.rb +++ b/spec/audited/sweeper_spec.rb @@ -1,5 +1,7 @@ require "spec_helper" +SingleCov.covered! + class AuditsController < ActionController::Base before_action :populate_user diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1818d25e2..0ba962f21 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,7 @@ ENV['RAILS_ENV'] = 'test' +require 'bundler/setup' +require 'single_cov' +SingleCov.setup :rspec require 'bundler' if Bundler.definition.dependencies.map(&:name).include?('protected_attributes')