Sha256: 77b9afcc930ac7c345bd4dcec665d27205202dce2839a8b8a35ac730abda73ca

Contents?: true

Size: 870 Bytes

Versions: 9

Compression:

Stored size: 870 Bytes

Contents

if defined?(ActiveRecord::Base)
  Before do
    $__cucumber_global_use_txn = !!Cucumber::Rails::World.use_transactional_fixtures if $__cucumber_global_use_txn.nil?
  end

  Before('~@no-txn') do
    Cucumber::Rails::World.use_transactional_fixtures = $__cucumber_global_use_txn
  end

  Before('@no-txn') do
    Cucumber::Rails::World.use_transactional_fixtures = false
  end

  Before do
    if Cucumber::Rails::World.use_transactional_fixtures
      run_callbacks :setup if respond_to?(:run_callbacks)
    end
    ActionMailer::Base.deliveries = [] if defined?(ActionMailer::Base)
  end

  After do
    if Cucumber::Rails::World.use_transactional_fixtures
      run_callbacks :teardown if respond_to?(:run_callbacks)
    end
  end
else
  module Cucumber::Rails
    def World.fixture_table_names; []; end # Workaround for projects that don't use ActiveRecord
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
cucumber-rails-0.1.1.rc4 lib/cucumber/rails/active_record.rb
cucumber-rails-0.1.1.rc3 lib/cucumber/rails/active_record.rb
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/rails/active_record.rb
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/rails/active_record.rb
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/rails/active_record.rb
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/rails/active_record.rb
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/rails/active_record.rb
cucumber-0.4.4 lib/cucumber/rails/active_record.rb
cucumber-rails-0.1.1.rc2 lib/cucumber/rails/active_record.rb