spec/spec_helper.rb in testcentricity-2.4.3 vs spec/spec_helper.rb in testcentricity-3.0.0
- old
+ new
@@ -1,14 +1,33 @@
-require "bundler/setup"
-require "testcentricity"
+# frozen_string_literal: true
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
+require 'capybara/rspec'
+require 'require_all'
+require 'simplecov'
+require 'testcentricity'
+require 'testcentricity_web'
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
+require_rel 'fixtures'
- config.expect_with :rspec do |c|
- c.syntax = :expect
+include TestCentricity
+
+SimpleCov.command_name("RSpec-#{Time.now.strftime('%Y%m%d%H%M%S')}")
+
+$LOAD_PATH << './lib'
+
+# set the default locale and auto load all translations from config/locales/*.rb,yml.
+ENV['LOCALE'] = 'en-US' unless ENV['LOCALE']
+I18n.load_path += Dir['config/locales/*.{rb,yml}']
+I18n.default_locale = 'en-US'
+I18n.locale = ENV['LOCALE']
+Faker::Config.locale = ENV['LOCALE']
+
+# prevent Test::Unit's AutoRunner from executing during RSpec's rake task
+Test::Unit.run = true if defined?(Test::Unit) && Test::Unit.respond_to?(:run=)
+
+RSpec.configure do |config|
+ config.mock_with :rspec do |mocks|
+ mocks.allow_message_expectations_on_nil = true
+ mocks.verify_doubled_constant_names = true
+ mocks.verify_partial_doubles = true
end
end