From 478cd2ed5c4e4651a5fa4e9ed7ccf8fb795bd2cf Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Thu, 21 Jan 2016 20:32:32 +0100 Subject: [PATCH] check database.yml path --- spec/spec_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4db2fc676f..90be4e8a0a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,9 @@ end # Must be explicit as activerecord is optional dependency require 'active_record/railtie' -unless File.exist?('config/database.yml') || File.exist?(File.expand_path('~/.msf4/database.yml')) +require 'metasploit/framework/database' +# check if database.yml is present +unless Metasploit::Framework::Database.configurations_pathname.try(:to_path) fail 'RSPEC currently needs a configured database' end