fix rspec errors without database

bug/bundler_fix
Christian Mehlmauer 2016-01-19 20:28:58 +01:00
parent a030179577
commit aaa1174ca5
No known key found for this signature in database
GPG Key ID: DCF54A05D6E62591
2 changed files with 5 additions and 1 deletions

View File

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

View File

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