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:
Petteri Räty 2012-12-06 14:52:21 +02:00
parent 65b6b4822f
commit 510f1bb48d

View file

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