Sha256: 78344803bae2c53221ba1e0d1c71963f546ba5ce16abe74c3879f3ced581a7c8

Contents?: true

Size: 604 Bytes

Versions: 3

Compression:

Stored size: 604 Bytes

Contents

require 'spec_helper'

class Mock
  include ActiveRecord::ConnectionHandling
  def logger
    nil
  end
end

describe ActiveRecord::ConnectionHandling do

  it 'raises NoDatabaseError correctly' do
    error_class = defined?(ActiveRecord::NoDatabaseError) ? ActiveRecord::NoDatabaseError : Mysql2::Error
    expect {
      Mock.new.pedant_mysql2_connection({
        host: TestSupport::DB_CONFIG['hostname'],
        username: TestSupport::DB_CONFIG['username'],
        password: TestSupport::DB_CONFIG['password'],
        database: 'nosuchthing',
      })
    }.to raise_error(error_class)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activerecord-pedantmysql2-adapter-1.4.0 spec/connection_spec.rb
activerecord-pedantmysql2-adapter-1.3.1 spec/connection_spec.rb
activerecord-pedantmysql2-adapter-1.3.0 spec/connection_spec.rb