Sha256: 8835d8c9ce71442bc1e01decd13cee3204a44c3f353273aeb741b961c53c2c74

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

called_from_env_rb = caller.detect { |f| f.include? '/env.rb:' }

if called_from_env_rb
  env_caller = File.dirname(called_from_env_rb)

  require 'rails'
  require 'cucumber/rails/application'
  ENV['RAILS_ENV'] ||= 'test'
  ENV['RAILS_ROOT'] ||= File.expand_path("#{env_caller}/../..")
  require File.expand_path("#{ENV['RAILS_ROOT']}/config/environment")
  require 'cucumber/rails/action_dispatch'
  require 'rails/test_help'

  unless Rails.application.config.cache_classes || defined?(Spring)
    warn "WARNING: You have set Rails' config.cache_classes to false
    (Spring needs cache_classes set to false). This is known to cause problems
    with database transactions. Set config.cache_classes to true if you want to use transactions."
  end

  require 'cucumber/rails/world'
  require 'cucumber/rails/hooks'
  require 'cucumber/rails/capybara'
  require 'cucumber/rails/database/strategy'
  require 'cucumber/rails/database/deletion_strategy'
  require 'cucumber/rails/database/shared_connection_strategy'
  require 'cucumber/rails/database/truncation_strategy'
  require 'cucumber/rails/database'

  MultiTest.disable_autorun
else
  warn "WARNING: Cucumber-rails required outside of env.rb.  The rest of loading is being deferred
  until env.rb is called. To avoid this warning, move 'gem \'cucumber-rails\', require: false'
  under only group :test in your Gemfile. If already in the :test group, be sure you are
  specifying 'require: false'."
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-rails-2.4.0 lib/cucumber/rails.rb
cucumber-rails-2.3.0 lib/cucumber/rails.rb
cucumber-rails-2.2.0 lib/cucumber/rails.rb