fix rspec errors without database
parent
a030179577
commit
aaa1174ca5
|
@ -49,7 +49,7 @@ module Metasploit
|
|||
#
|
||||
# @return [void]
|
||||
def self.optionally_active_record_railtie
|
||||
if ::File.exist?(Rails.application.config.paths['config/database'].first)
|
||||
if ::File.exist?('config/database.yml')
|
||||
optionally(
|
||||
'active_record/railtie',
|
||||
'activerecord not in the bundle, so database support will be disabled.'
|
||||
|
|
|
@ -11,6 +11,10 @@ end
|
|||
# Must be explicit as activerecord is optional dependency
|
||||
require 'active_record/railtie'
|
||||
|
||||
unless File.exist?('config/database.yml')
|
||||
fail 'RSPEC currently needs a configured database'
|
||||
end
|
||||
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
|
||||
# Don't `require 'rspec/rails'` as it includes support for pieces of rails that metasploit-framework doesn't use
|
||||
|
|
Loading…
Reference in New Issue