Sha256: 633fc7c1e31685ff2c629a645260f581e33d17531c457396c29cec6444333919

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

require 'rubygems'
require 'spec'
require 'yaml'
begin
  require 'activerecord'
rescue LoadError
  raise "dependency ActiveRecord not found.  try: $ sudo gem install activerecord"
end

require File.dirname(__FILE__) + '/../lib/activerecord-comments'

# right now, we run all tests against MySQL (I would also do sqlite but I don't think it supports comments!)
database_hash = YAML::load File.read(File.dirname(__FILE__) + '/spec_database.yml')
ActiveRecord::Base.establish_connection database_hash

begin
  # touch the connection to see if it's OK
  ActiveRecord::Base.connection
rescue Mysql::Error => ex
  if ex.to_s =~ /unknown database/i
    db = database_hash['database']
    raise "\n\nMySQL database not found: #{db}.\ntry: $ mysqladmin create #{db}\n\n"
  else
    raise ex
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
openrain-activerecord-comments-0.1.1 spec/spec_helper.rb
remi-activerecord-comments-0.1.0 spec/spec_helper.rb
remi-activerecord-comments-0.1.1 spec/spec_helper.rb