Sha256: d9e991692aa99113bda1ab075dbb718ff0bffaca3c8585260518581d70c57d46

Contents?: true

Size: 980 Bytes

Versions: 1

Compression:

Stored size: 980 Bytes

Contents

require 'active_git'
require 'logger'

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

ActiveRecord::Base.logger = Logger.new($stdout)
ActiveRecord::Migrator.migrations_path = "#{File.dirname(__FILE__)}/migrations"

module InflectorHelper
  def git_dirname(model, working_path=nil)
    ActiveGit::Inflector.dirname(model, working_path || ActiveGit.configuration.working_path)
  end

  def git_filename(instance, working_path=nil)
    ActiveGit::Inflector.filename(instance, working_path || ActiveGit.configuration.working_path)
  end
end

RSpec.configure do |config|

  config.around do |example|
    ActiveRecord::Base.transaction do
      example.run
      raise ActiveRecord::Rollback
    end
  end

  config.before :all do
    ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ":memory:"
    ActiveRecord::Base.connection
    ActiveRecord::Migrator.migrate ActiveRecord::Migrator.migrations_path
  end

  include InflectorHelper

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_git-0.0.4 spec/spec_helper.rb