mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Expose original exception if orm can't loaded
When running cucumber expose the original exception so that it's easier to debug what's going on. I could not load couchpotato because of require problems down the stack and with this I can see the actual problem. With bundler we always have the dependencies installed.
This commit is contained in:
parent
65b6b4822f
commit
510f1bb48d
1 changed files with 2 additions and 11 deletions
|
@ -20,19 +20,10 @@ if orm && strategy
|
|||
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
||||
require 'database_cleaner'
|
||||
require 'database_cleaner/cucumber'
|
||||
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm.downcase}_models"
|
||||
rescue LoadError => e
|
||||
raise "You don't have the #{orm} ORM installed"
|
||||
end
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm.downcase}_models"
|
||||
|
||||
if another_orm
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{another_orm.downcase}_models"
|
||||
rescue LoadError => e
|
||||
raise "You don't have the #{another_orm} ORM installed"
|
||||
end
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{another_orm.downcase}_models"
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue