changing the rake spec task to auto run db:test:prepare

bug/bundler_fix
darkbushido 2016-12-12 11:41:16 -06:00
parent bb64f5d7e3
commit 2c8772efe7
1 changed files with 13 additions and 0 deletions

View File

@ -9,6 +9,19 @@ require 'metasploit/framework/spec/untested_payloads'
# the user installs with `bundle install --without db`
Metasploit::Framework::Require.optionally_active_record_railtie
begin
require 'rspec/core'
rescue LoadError
puts "rspec not in bundle, so can't set up spec tasks. " \
"To run specs ensure to install the development and test groups."
puts "Bundle currently installed '--without #{Bundler.settings.without.join(' ')}'."
puts "To clear the without option do `bundle install --without ''` (the --without flag with an empty string) or " \
"`rm -rf .bundle` to remove the .bundle/config manually and then `bundle install`"
else
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(spec: 'db:test:prepare')
end
Metasploit::Framework::Application.load_tasks
Metasploit::Framework::Spec::Constants.define_task
Metasploit::Framework::Spec::Threads::Suite.define_task