Sha256: 1a32ef2e304d0e55c4ad409b8e9845e86c28ceec491b7a65a7188f7540ed996f

Contents?: true

Size: 832 Bytes

Versions: 30

Compression:

Stored size: 832 Bytes

Contents

require 'lib/activerecord_test_connector'

class ActiveRecordTestCase < Test::Unit::TestCase
  # 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

30 entries across 30 versions & 16 rubygems

Version Path
decisiv-will_paginate-2.3.6.1 test/lib/activerecord_test_case.rb
decisiv-will_paginate-2.3.6 test/lib/activerecord_test_case.rb
dweinand-will_paginate-2.3.4 test/lib/activerecord_test_case.rb
dweinand-will_paginate-2.3.7 test/lib/activerecord_test_case.rb
gohanlon-will_paginate-2.3.3 test/lib/activerecord_test_case.rb
jcnetdev-will_paginate-2.3.21 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.2.3 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.0 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.1 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.2 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.3 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.4 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.5 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.6 test/lib/activerecord_test_case.rb
mislav-will_paginate-2.3.7 test/lib/activerecord_test_case.rb
myobie-will_paginate-2.3.5 test/lib/activerecord_test_case.rb
oboxodo-will_paginate-2.3.5 test/lib/activerecord_test_case.rb
pcg79-will_paginate-2.3.2 test/lib/activerecord_test_case.rb
shingara-will_paginate-2.3.3 test/lib/activerecord_test_case.rb
sjain-natural_key-0.0.1 test/lib/activerecord_test_case.rb