diff --git a/features/msfconsole.feature b/features/msfconsole.feature index 4a1be16753..5b60b5ed46 100644 --- a/features/msfconsole.feature +++ b/features/msfconsole.feature @@ -33,7 +33,12 @@ Feature: Launching `msfconsole` Then the output should contain "[-] Failed to connect to the database: could not connect to server" Then the output should contain "[*] postgresql selected, no connection" - + Scenario: Starting `msfconsole` with a valid database.yml + Given I run `msfconsole` interactively + And I wait for stdout to contain "Free Metasploit Pro trial: http://r-7.co/trymsp" + When I type "db_status" + And I type "exit" + Then the output should contain "[*] postgresql connected to metasploit_framework_test" diff --git a/features/support/hooks.rb b/features/support/hooks.rb index ae2da77120..407af2dba4 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -1,3 +1,7 @@ +Before do + set_env('RAILS_ENV', 'test') +end + Before('@msfconsole') do step 'I run `msfconsole` interactively' step 'I wait for stdout to contain "Free Metasploit Pro trial: http://r-7.co/trymsp"'