Sha256: d9bc3c0290e859656fad38eecdd96a5456f1e2cbdeb786786cc8b470bc578c95

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

require 'pathname'
require 'rubygems'
 
gem 'rspec', '>=1.1.12'
require 'spec'
 
gem 'dm-core', '0.9.11'
require 'dm-core'
 
gem 'dm-validations', '0.9.11'
require 'dm-validations'
 
require Pathname(__FILE__).dirname.parent.expand_path + 'lib/dm-accepts_nested_attributes'
 
ENV["SQLITE3_SPEC_URI"]  ||= 'sqlite3::memory:'
ENV["MYSQL_SPEC_URI"]    ||= 'mysql://localhost/dm_core_test'
ENV["POSTGRES_SPEC_URI"] ||= 'postgres://postgres@localhost/dm_more_test'
 
 
def setup_adapter(name, default_uri = nil)
  begin
    DataMapper.setup(name, ENV["#{ENV['ADAPTER'].to_s.upcase}_SPEC_URI"] || default_uri)
    Object.const_set('ADAPTER', ENV['ADAPTER'].to_sym) if name.to_s == ENV['ADAPTER']
    true
  rescue Exception => e
    if name.to_s == ENV['ADAPTER']
      Object.const_set('ADAPTER', nil)
      warn "Could not load do_#{name}: #{e}"
    end
    false
  end
end
 
ENV['ADAPTER'] ||= 'sqlite3'

 
setup_adapter(:default)
Dir[Pathname(__FILE__).dirname.to_s + "/fixtures/**/*.rb"].each { |rb| require(rb) }


# -----------------------------------------------
# support for nice html output in rspec tmbundle
# -----------------------------------------------

USE_TEXTMATE_RSPEC_BUNDLE = true # set to false if not using textmate

if USE_TEXTMATE_RSPEC_BUNDLE

  require Pathname(__FILE__).dirname.expand_path + 'shared/rspec_tmbundle_support'

  # use the tmbundle logger
  RSpecTmBundleHelpers::TextmateRspecLogger.new(STDOUT, :off)

  class Object
    include RSpecTmBundleHelpers
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snusnu-dm-accepts_nested_attributes-0.0.1 spec/spec_helper.rb