Sha256: ee09feeca59ab4e2c385cfa0fd64501809389f1dc038dd00481601450afc72cd

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

require "bundler/setup"
require "rspec/json_expectations"
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("dummy/config/environment", __dir__)
abort("The Rails environment is running in production mode!") if Rails.env.production?
require "rspec/rails"
require "dotenv"

env_file = ENV["CI"] == "true" ? ".env.ci" : ".env.local"
raise "Expected #{env_file}" unless File.exist?(env_file)

Dotenv.load(env_file)

# Load RSpec helpers.
ENGINE_ROOT ||= File.expand_path("..", __dir__)
Dir[File.join(ENGINE_ROOT, "spec/support/**/*.rb")].sort.each { |f| require f }

# Load migrations from the dummy app.
# ActiveRecord::Migrator.migrations_paths = File.join(ENGINE_ROOT, 'spec/dummy/db/migrate')
begin
  ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
  puts e.to_s.strip
  exit 1
end

RSpec.configure do |config|
  config.example_status_persistence_file_path = ".rspec_status"

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.use_transactional_fixtures = true

  config.expect_with :rspec do |c|
    c.syntax = :expect
    c.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.shared_context_metadata_behavior = :apply_to_host_groups
  config.filter_rails_from_backtrace!
  config.use_transactional_fixtures = true

  config.include(Kafka)
  config.extend(Skip)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nulogy_message_bus_consumer-3.0.0 spec/spec_helper.rb
nulogy_message_bus_consumer-2.0.1 spec/spec_helper.rb
nulogy_message_bus_consumer-2.0.0 spec/spec_helper.rb
nulogy_message_bus_consumer-1.0.0 spec/spec_helper.rb