Sha256: 451998adefd2355cf5a59a1817bda22a95417c18ca619d921062fc0584ce9f5b

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

require './test/abstract'

TestCase = begin
             require 'minitest/unit'
             MiniTest::Unit.autorun
             MiniTest::Unit::TestCase
           rescue LoadError
             require 'test/unit'
             Test::Unit::TestCase
           end

%w[sqlite postgres mysql].each{ |adapter|
  begin
    require "dm-#{adapter}-adapter"
  rescue LoadError
    puts "skip #{adapter} test since it's not installed"
  end
}

# cost 1 second to run
class SqliteTest < TestCase
  include Abstract

  def self.setup_data_mapper
    DataMapper.setup(:default, 'sqlite::memory:')
  end
end if defined?(DataMapper::Adapters::SqliteAdapter)

class SqliteHashSetupTest < TestCase
  include Abstract
  def self.setup_data_mapper
    DataMapper.setup(:default, :adapter => 'sqlite', :database => ':memory:')
  end
end if defined?(DataMapper::Adapters::SqliteAdapter)

# cost 2 seconds to run
class PostgresTest < TestCase
  include Abstract

  def self.setup_data_mapper
    DataMapper.setup(:default, 'postgres://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::PostgresAdapter)

# cost 8 seconds to run (what the hell??)
class MysqlTest < TestCase
  include Abstract

  def self.setup_data_mapper
    DataMapper.setup(:default, 'mysql://dm_is_reflective:godfat@localhost/dm_is_reflective')
  end
end if defined?(DataMapper::Adapters::MysqlAdapter)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-is-reflective-1.1.0 test/test_dm-is-reflective.rb