mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
72f60fae94
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.
25 lines
409 B
Ruby
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
|