2018-10-07 21:45:51 -04:00
|
|
|
require "rspec"
|
|
|
|
require "rspec/its"
|
2009-04-11 11:27:23 -04:00
|
|
|
|
2012-03-09 16:14:06 -05:00
|
|
|
require "simplecov"
|
|
|
|
|
2018-10-07 21:45:51 -04:00
|
|
|
require "factory_bot"
|
2010-11-11 16:33:45 -05:00
|
|
|
|
2021-03-29 20:18:27 -04:00
|
|
|
if RUBY_ENGINE == "jruby"
|
|
|
|
# Workaround for issue in I18n/JRuby combo.
|
|
|
|
# See https://github.com/jruby/jruby/issues/6547 and
|
|
|
|
# https://github.com/ruby-i18n/i18n/issues/555
|
|
|
|
require "i18n/backend"
|
|
|
|
require "i18n/backend/simple"
|
|
|
|
end
|
|
|
|
|
2011-08-16 23:30:09 -04:00
|
|
|
Dir["spec/support/**/*.rb"].each { |f| require File.expand_path(f) }
|
|
|
|
|
2010-11-11 16:33:45 -05:00
|
|
|
RSpec.configure do |config|
|
2017-06-01 12:54:02 -04:00
|
|
|
config.mock_with :rspec do |mocks|
|
|
|
|
# Prevents you from mocking or stubbing a method that does not exist on a
|
|
|
|
# real object. This is generally recommended, and will default to `true` in
|
|
|
|
# RSpec 4.
|
|
|
|
mocks.verify_partial_doubles = true
|
|
|
|
end
|
2011-08-12 22:06:10 -04:00
|
|
|
|
2011-10-14 15:14:43 -04:00
|
|
|
config.include DeclarationMatchers
|
|
|
|
|
2017-06-14 08:00:47 -04:00
|
|
|
config.before do
|
2017-10-20 15:20:28 -04:00
|
|
|
FactoryBot.reload
|
2017-06-14 08:00:47 -04:00
|
|
|
end
|
|
|
|
|
2018-05-21 11:25:03 -04:00
|
|
|
config.order = :random
|
|
|
|
Kernel.srand config.seed
|
2018-11-21 22:02:52 -05:00
|
|
|
|
|
|
|
config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
|
2009-04-11 11:27:23 -04:00
|
|
|
end
|