Sha256: 9e68b2600ed2b15a6c111a9b8dcc8a38452dea3f0457b5aa1c356b46ad8c3049

Contents?: true

Size: 734 Bytes

Versions: 2

Compression:

Stored size: 734 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'dm-tokyo-adapter'

class Test::Unit::TestCase
end

DataMapper::Logger.new(STDOUT, :debug) if $VERBOSE
DataMapper.setup(:default, {
  :adapter  => 'tokyo_cabinet',
  :database => 'tc',
  :path     => File.dirname(__FILE__)
})

class Test::Unit::TestCase
  include Extlib::Hook

  # after :teardown do
  def teardown
    descendants = DataMapper::Model.descendants.dup.to_a
    while model = descendants.shift
      descendants.concat(model.descendants) if model.respond_to?(:descendants)
      Object.send(:remove_const, model.name.to_sym)
      DataMapper::Model.descendants.delete(model)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shanna-dm-tokyo-adapter-0.3.0 test/helper.rb
shanna-dm-tokyo-adapter-0.3.1 test/helper.rb