Sha256: ec959ef18fe88d5c52a93e66c459dbd2b6d710d412bf7bbfb71b09be35a4e9f1

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

# coding: utf-8

require 'rubygems'
require 'bundler/setup'
require 'pry'
require 'coveralls'
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  add_filter '/spec/'
end

SimpleCov.at_exit do
  File.open(File.join(SimpleCov.coverage_path, 'percent.txt'), 'w') do |f|
    f.write SimpleCov.result.covered_percent
  end
  SimpleCov.result.format!
end

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../dummy/config/environment', __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'database_cleaner'
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.order = 'random'

  # DatabaseCleaner
  config.before(:suite) do
    DatabaseCleaner[:mongoid].strategy = :truncation
    DatabaseCleaner[:mongoid].clean_with :truncation
  end

  config.before(:each) do
    DatabaseCleaner[:mongoid].start
  end

  config.after(:each) do
    DatabaseCleaner[:mongoid].clean
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
re_track-0.7.5 spec/spec_helper.rb
re_track-0.7.4 spec/spec_helper.rb
re_track-0.7.2 spec/spec_helper.rb
re_track-0.7.1 spec/spec_helper.rb
re_track-0.7.0 spec/spec_helper.rb
re_track-0.6.0 spec/spec_helper.rb
re_track-0.5.2 spec/spec_helper.rb
re_track-0.5.1 spec/spec_helper.rb
re_track-0.5.0 spec/spec_helper.rb