Sha256: d9b6f1570a30815356108a7450eaf6c19270581f164937547d5e3ebb299ff75c

Contents?: true

Size: 1.36 KB

Versions: 3

Compression:

Stored size: 1.36 KB

Contents

require 'bundler'
require 'bundler/setup'
Bundler.require(:default, :development)

#---------------------------------------------------------------------------------------------------

__DIR__ = Pathname.new(__FILE__).dirname
$LOAD_PATH.unshift __DIR__
$LOAD_PATH.unshift __DIR__ + '../lib'

#---------------------------------------------------------------------------------------------------
# ActiveRecord

require 'active_record'

log_file_path = __DIR__ + 'test.log'
log_file_path.truncate(0) rescue nil
ActiveRecord::Base.logger = Logger.new(log_file_path)

driver = (ENV["DB"] or "sqlite3").downcase
database_config = YAML::load(File.open(__DIR__ + "support/database.#{driver}.yml"))
ActiveRecord::Base.establish_connection(database_config)

require __DIR__ + 'support/schema'
require 'generators/address_concern/templates/migration'
CreateAddresses.up

#---------------------------------------------------------------------------------------------------
# RSpec

require 'rspec'

RSpec.configure do |config|
  #config.include AttributeNormalizer::RSpecMatcher #, :type => :models
  config.example_status_persistence_file_path = "tmp/rspec_status.txt"
end

require 'address_concern'

require_relative 'support/models/application_record'
require_relative 'support/models/address'

# Requires supporting ruby files in spec/support/
Dir[__DIR__ + 'support/**/*.rb'].each do |f|
  require f
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
address_concern-3.0.0 spec/spec_helper.rb
address_concern-2.1.1 spec/spec_helper.rb
address_concern-2.1.0 spec/spec_helper.rb