Skip to content

Instantly share code, notes, and snippets.

@jesperronn jesperronn/.simplecov
Last active Jun 19, 2018

Embed
What would you like to do?
CircleCI Simplecov artifact (https://circleci.com/docs/code-coverage)
SimpleCov.coverage_dir('tmp/coverage')
# save to CircleCI's artifacts directory if we're on CircleCI
# see https://circleci.com/docs/code-coverage
if ENV['CIRCLE_ARTIFACTS']
dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
SimpleCov.coverage_dir(dir)
end
require 'simplecov-csv'
require 'simplecov-cobertura'
require 'simplecov-json'
require 'simplecov-text'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::CSVFormatter,
SimpleCov::Formatter::CoberturaFormatter,
SimpleCov::Formatter::JSONFormatter,
SimpleCov::Formatter::TextFormatter
]
SimpleCov.start 'rails'
group :test do
gem 'simplecov', require: false
gem 'simplecov-cobertura', require: false
gem 'simplecov-csv', require: false
gem 'simplecov-json', require: false
gem 'simplecov-text', require: false
end
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
# The different available types are documented in the features, such as in
# https://relishapp.com/rspec/rspec-rails/docs
config.infer_spec_type_from_file_location!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.