Sha256: 6e180e7613086fef542e5acba42133cfada17ab2a96bbb0a6ea95809eb4c2fc6

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'active_support'
require 'active_support/test_case'
require 'mocha'

$LOAD_PATH << File.expand_path( File.dirname(__FILE__) + '/../lib' )

class ActiveSupport::TestCase
  def reset_db!( schema_path )
    ::ActiveRecord::Migration.verbose = false   # Quiet down the migration engine
    ::ActiveRecord::Base.establish_connection({
      :adapter => 'sqlite3',
      :dbfile => ':memory:'
    })
    ::ActiveRecord::Base.silence do
      load schema_path
    end
  end
  
  def assert_member(item, arr)
    assert_block "Item #{item} is not in array #{arr}" do
      arr.member? item
    end
  end
end

module ActiveRecord
  module ConnectionAdapters
    class AbstractAdapter
      def index_exists?(table_name, column_name)
        indexes(table_name).any? { |index| index.name == index_name(table_name, column_name) }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kriss-gettext_i18n-0.2.0 vendor/globalize2/test/test_helper.rb
kriss-gettext_i18n-0.2.1 vendor/globalize2/test/test_helper.rb
kriss-gettext_i18n-0.2.2 vendor/globalize2/test/test_helper.rb
kriss-gettext_i18n-0.2.3 vendor/globalize2/test/test_helper.rb