mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
require abstract_mysql_adapter if it exists
This commit is contained in:
parent
9fa407b12d
commit
64e77d0bfa
3 changed files with 11 additions and 4 deletions
6
Gemfile
6
Gemfile
|
@ -16,11 +16,11 @@ group :development do
|
|||
gem "dm-migrations", "1.0.0"
|
||||
gem "dm-sqlite-adapter", "1.0.0"
|
||||
gem "mongoid"
|
||||
gem "tzinfo"
|
||||
gem "tzinfo"
|
||||
gem "mongo_ext"
|
||||
gem "bson_ext"
|
||||
gem "mongo_mapper"
|
||||
gem "couch_potato"
|
||||
gem "mongo_mapper"
|
||||
gem "couch_potato"
|
||||
gem "sequel", "~>3.21.0"
|
||||
#gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed
|
||||
gem 'mysql'
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
require 'active_record/base'
|
||||
|
||||
require 'active_record/connection_adapters/abstract_adapter'
|
||||
|
||||
begin
|
||||
require 'active_record/connection_adapters/abstract_mysql_adapter'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require "database_cleaner/generic/truncation"
|
||||
require 'database_cleaner/active_record/base'
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe ::DatabaseCleaner do
|
|||
|
||||
context "orm specification" do
|
||||
it "should not accept unrecognised orms" do
|
||||
expect { ::DatabaseCleaner[nil] }.should raise_error(::DatabaseCleaner::NoORMDetected)
|
||||
expect { ::DatabaseCleaner[nil] }.to raise_error(::DatabaseCleaner::NoORMDetected)
|
||||
end
|
||||
|
||||
it "should accept :active_record" do
|
||||
|
|
Loading…
Reference in a new issue