Sha256: 4fe10b2d30ddcba2a4b1491dba16fb02c5712b71f863b9f37c314990f1b0114a

Contents?: true

Size: 848 Bytes

Versions: 13

Compression:

Stored size: 848 Bytes

Contents

require 'rspec'
require 'cantango/config'
require 'active_record'

require 'cutter'
require 'yaml'
require 'logger'
require 'database_cleaner'

require 'factory_girl'
FactoryGirl.find_definitions

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

DatabaseCleaner.strategy = :truncation

RSpec.configure do |config|
end

def connect_db
  path = File.dirname(__FILE__) + '/db/database.yml'
  dbfile = File.open(path)
  dbconfig = YAML::load(dbfile)
  ActiveRecord::Base.establish_connection(dbconfig)
  ActiveRecord::Base.logger = Logger.new(STDERR)
  DatabaseCleaner.clean  
end

def migrate
  folder = File.join(File.dirname(__FILE__), 'migrations')
  puts "Migrate: #{folder}"
  ActiveRecord::Migrator.migrate folder
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cantango-config-0.2.1 spec/spec_helper.rb
cantango-config-0.2.0 spec/spec_helper.rb
cantango-config-0.1.9.2 spec/spec_helper.rb
cantango-config-0.1.8.1 spec/spec_helper.rb
cantango-config-0.1.8 spec/spec_helper.rb
cantango-config-0.1.7 spec/spec_helper.rb
cantango-config-0.1.6 spec/spec_helper.rb
cantango-config-0.1.5 spec/spec_helper.rb
cantango-config-0.1.4 spec/spec_helper.rb
cantango-config-0.1.3 spec/spec_helper.rb
cantango-config-0.1.2 spec/spec_helper.rb
cantango-config-0.1.1 spec/spec_helper.rb
cantango-config-0.1.0 spec/spec_helper.rb