Sha256: 0eee295add59c92ae73125a3b9faa71e822589256d76eada641007f75a6909a7

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

unless defined?(Test)
  begin
    require 'spec/test/unit'
  rescue LoadError => ignore_if_rspec_not_installed
  end
end

if defined?(ActiveRecord::Base)
  require 'test_help' 
else
  # I can't do rescue LoadError because in this files could be loaded
  # from rails gem (ie. load actionpack 2.3.5 if rubygems are not disabled)
  if Rails.version.to_f < 3.0
    require 'action_controller/test_process'
    require 'action_controller/integration'
  else
    require 'action_dispatch/testing/test_process'
    require 'action_dispatch/testing/integration'
  end
end

require 'cucumber/rails/test_unit'
require 'cucumber/rails/action_controller'


if (::Rails.respond_to?(:application) && !(::Rails.application.config.cache_classes)) || 
  (!(::Rails.respond_to?(:application)) && ::Rails.respond_to?(:configuration) && !(::Rails.configuration.cache_classes))
  warn "WARNING: You have set Rails' config.cache_classes to false (most likely in config/environments/cucumber.rb).  This setting is known to break Cucumber's use_transactional_fixtures method. Set config.cache_classes to true if you want to use transactional fixtures.  For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165."
end

module Cucumber #:nodoc:
  module Rails
    class World < ActionController::IntegrationTest
      include ActiveSupport::Testing::SetupAndTeardown if ActiveSupport::Testing.const_defined?("SetupAndTeardown")
      def initialize #:nodoc:
        @_result = Test::Unit::TestResult.new
      end
    end
  end
end

World do
  Cucumber::Rails::World.new
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cucumber-rails-0.2.4 lib/cucumber/rails/world.rb