require abstract_mysql_adapter if it exists

This commit is contained in:
stanislaw 2012-08-02 22:18:06 +03:00 committed by Ben Mabey
parent 9fa407b12d
commit 64e77d0bfa
3 changed files with 11 additions and 4 deletions

View file

@ -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'

View file

@ -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'

View file

@ -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