spec/spec_helper.rb in dispatch-rider-1.9.0 vs spec/spec_helper.rb in dispatch-rider-2.0.0

- old
+ new

@@ -1,16 +1,44 @@ -require 'bundler' +# frozen_string_literal: true +require 'bundler/setup' + +require 'simplecov' +require 'coveralls' + +if RUBY_VERSION < "3.1" + SimpleCov.start 'rails' do + if ENV['CI'] + require 'simplecov-lcov' + + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = 'coverage/lcov.info' + end + + formatter SimpleCov::Formatter::LcovFormatter + end + + add_filter '/bin/' + add_filter '/script/' + add_filter '/db/' + add_filter '/spec/' # for rspec + add_filter '/test/' # for minitest + end + + Coveralls.wear!('rails') +end + Bundler.setup Bundler.require(:default, :development) require 'dispatch-rider' Dir['./spec/support/**/*.rb'].each { |fn| require(fn) } -FactoryGirl.definition_file_paths = %w{spec/factories/} -FactoryGirl.find_definitions +FactoryBot.definition_file_paths = %w{spec/factories/} +FactoryBot.find_definitions RSpec.configure do |config| config.raise_errors_for_deprecations! config.mock_with :rspec config.order = 'random' @@ -40,10 +68,10 @@ config.after do DispatchRider::ScheduledJob.destroy_all end - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods end # Airbrake dummy module module Airbrake end