Sha256: 9198d00cf42e2340a12f186b029b42ff2ebbc7e43f2c59d50c12f195d09e1c1f

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 KB

Contents

require 'rubygems'
require 'active_support'
require 'active_support/test_case'
require 'shoulda'

ENV['RAILS_ENV'] = 'test'
ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..'

require 'test/unit'
require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb'))

def connect_to_database
  config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
  ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")

  db_adapter = ENV['DB']

  # no db passed, try one of these fine config-free DBs before bombing.
  db_adapter ||=
    begin
      require 'rubygems'
      require 'sqlite'
      'sqlite'
    rescue MissingSourceFile
      begin
        require 'sqlite3'
        'sqlite3'
      rescue MissingSourceFile
      end
    end

  if db_adapter.nil?
    raise "No DB Adapter selected. Pass the DB= option to pick one, or install Sqlite or Sqlite3."
  end

  ActiveRecord::Base.establish_connection(config[db_adapter])
end

def load_schema
  connect_to_database
  load(File.dirname(__FILE__) + "/schema.rb")
  require File.dirname(__FILE__) + '/../rails/init.rb'
end

def change_schema
  load(File.dirname(__FILE__) + "/schema_change.rb")
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
airblade-paper_trail-1.0.1 test/test_helper.rb
airblade-paper_trail-1.1.0 test/test_helper.rb
airblade-paper_trail-1.1.1 test/test_helper.rb
jeremyw-paper_trail-1.2.10 test/test_helper.rb
jeremyw-paper_trail-1.2.12 test/test_helper.rb
jeremyw-paper_trail-1.2.2 test/test_helper.rb
jeremyw-paper_trail-1.2.3 test/test_helper.rb
jeremyw-paper_trail-1.2.5 test/test_helper.rb
jeremyw-paper_trail-1.2.6 test/test_helper.rb
jeremyw-paper_trail-1.2.7 test/test_helper.rb
jeremyw-paper_trail-1.2.8 test/test_helper.rb
jeremyw-paper_trail-1.2.9 test/test_helper.rb
jeremyw-paper_trail-1.2.14 test/test_helper.rb
paper_trail-1.2.14 test/test_helper.rb
paper_trail-1.2.13 test/test_helper.rb