1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/spec/support/tests/database_adapters/postgresql.rb
Elliot Winkler 72f60fae94 Add support for Postgres
When running tests, you can now switch between running them against a
SQLite or PostgreSQL database. This is accomplished by modifying the
unit and acceptance tests so that when they generate and load the test
Rails application, database.yml is replaced with content that will
configure the database appropriately.
2015-02-12 16:01:00 -07:00

25 lines
409 B
Ruby

module Tests
module DatabaseAdapters
class PostgreSQL
def self.name
:postgresql
end
attr_reader :database
def initialize(database)
@database = database
end
def adapter
self.class.name
end
def require_dependencies
require 'pg'
end
end
DatabaseConfigurationRegistry.instance.register(PostgreSQL)
end
end