Sha256: a73634dea491e7c802a70f1c73ad626d13a7f6841eee600785b25b841354bfa5

Contents?: true

Size: 1.01 KB

Versions: 71

Compression:

Stored size: 1.01 KB

Contents

require 'lib/activerecord_test_connector'

class ActiveRecordTestCase < Test::Unit::TestCase
  if defined?(ActiveSupport::Testing::SetupAndTeardown)
    include ActiveSupport::Testing::SetupAndTeardown
  end

  if defined?(ActiveRecord::TestFixtures)
    include ActiveRecord::TestFixtures
  end
  # Set our fixture path
  if ActiveRecordTestConnector.able_to_connect
    self.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
    self.use_transactional_fixtures = true
  end

  def self.fixtures(*args)
    super if ActiveRecordTestConnector.connected
  end

  def run(*args)
    super if ActiveRecordTestConnector.connected
  end

  # Default so Test::Unit::TestCase doesn't complain
  def test_truth
  end

  protected

    def assert_queries(num = 1)
      $query_count = 0
      yield
    ensure
      assert_equal num, $query_count, "#{$query_count} instead of #{num} queries were executed."
    end

    def assert_no_queries(&block)
      assert_queries(0, &block)
    end
end

ActiveRecordTestConnector.setup

Version data entries

71 entries across 71 versions & 21 rubygems

Version Path
decisiv-will_paginate-2.3.8.1 test/lib/activerecord_test_case.rb
fermion-will_paginate-2.3.8 test/lib/activerecord_test_case.rb
gcirne-will_paginate-2.3.8 test/lib/activerecord_test_case.rb
gigpark-will_paginate-2.3.11 test/lib/activerecord_test_case.rb
kamal-will_paginate-2.3.8 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.10 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.8 test/lib/activerecord_test_case.rb
shingara-will_paginate-2.3.10 test/lib/activerecord_test_case.rb
stilkov-will_paginate-2.3.8 test/lib/activerecord_test_case.rb
change_log-2.0.2 test/lib/activerecord_test_case.rb
change_log-2.0.1 test/lib/activerecord_test_case.rb
change_log-2.0.0 test/lib/activerecord_test_case.rb
change_log-1.0.5 test/lib/activerecord_test_case.rb
change_log-1.0.4 test/lib/activerecord_test_case.rb
change_log-1.0.3 test/lib/activerecord_test_case.rb
change_log-1.0.2 test/lib/activerecord_test_case.rb
will_mostly_paginate-2.4.3 test/lib/activerecord_test_case.rb
event_calendar_engine-0.2.15 vendor/plugins/searchable_by/test/lib/activerecord_test_case.rb
event_calendar_engine-0.2.14 vendor/plugins/searchable_by/test/lib/activerecord_test_case.rb
event_calendar_engine-0.2.13 vendor/plugins/searchable_by/test/lib/activerecord_test_case.rb