Sha256: 20616e520b6e391167ac2f00a9a2dd1ec4d053b7ace3f73ed7b3ab50bc7d9a8b

Contents?: true

Size: 580 Bytes

Versions: 9

Compression:

Stored size: 580 Bytes

Contents

def codeclimate?
  ENV['CODECLIMATE_REPO_TOKEN']
end

def simplecov?
  ENV['COVERAGE']
end

def coverage?
  simplecov? || codeclimate?
end

def measure_coverage
  require 'simplecov'
  formatters = []
  formatters << SimpleCov::Formatter::HTMLFormatter if simplecov?

  if codeclimate?
    require 'codeclimate-test-reporter'
    formatters << CodeClimate::TestReporter::Formatter
  end

  ignored_directories = ['/spec/', '/vendor/', '/.bundle/']
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
  SimpleCov.start { add_filter(ignored_directories) }
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wright-0.5.0 spec/spec_helpers/test_coverage.rb
wright-0.4.4 spec/spec_helpers/test_coverage.rb
wright-0.4.3 spec/spec_helpers/test_coverage.rb
wright-0.4.2 spec/spec_helpers/test_coverage.rb
wright-0.4.1 spec/spec_helpers/test_coverage.rb
wright-0.4.0 spec/spec_helpers/test_coverage.rb
wright-0.3.2 spec/spec_helpers/test_coverage.rb
wright-0.3.1 spec/spec_helpers/test_coverage.rb
wright-0.3.0 spec/spec_helpers/test_coverage.rb