From 8f3f37dd54c7cd3d9a799e29d720886285a2d402 Mon Sep 17 00:00:00 2001 From: darkbushido Date: Tue, 19 Aug 2014 15:05:47 -0500 Subject: [PATCH] updating how cucumber loads features starting to use a cucumber.yml to store the profile configs we will not be running @targets by default --- Rakefile | 11 ----------- config/cucumber.yml | 6 ++++++ features/support/env.rb | 5 ++--- features/support/hooks.rb | 2 +- lib/tasks/cucumber.rake | 20 ++++++++++++++++++++ 5 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 config/cucumber.yml create mode 100644 lib/tasks/cucumber.rake diff --git a/Rakefile b/Rakefile index 131e65844f..232a7351b2 100755 --- a/Rakefile +++ b/Rakefile @@ -9,14 +9,3 @@ require 'metasploit/framework/require' Metasploit::Framework::Require.optionally_active_record_railtie Metasploit::Framework::Application.load_tasks - -begin - require 'cucumber' - require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) do |t| - t.cucumber_opts = 'features --format pretty' - end -rescue LoadError - puts "cucumber not in bundle, so can't set up feature tasks. " \ - "To run features ensure to install the development and test groups." -end diff --git a/config/cucumber.yml b/config/cucumber.yml new file mode 100644 index 0000000000..13e2431649 --- /dev/null +++ b/config/cucumber.yml @@ -0,0 +1,6 @@ +# config/cucumber.yml +##YAML Template +--- +<% common = "--tags ~@wip --strict --tags ~@targets" %> +default: <%= common %> features +boot: <%= common %> --format html --out=features_report.html features \ No newline at end of file diff --git a/features/support/env.rb b/features/support/env.rb index c55133d40d..45fe01b25a 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,11 +1,10 @@ require 'aruba/cucumber' paths = [ - File.expand_path(File.join(File.dirname(__FILE__))), File.expand_path(File.join(File.dirname(__FILE__), %w(.. ..))), ENV['PATH'] ] ENV['PATH'] = paths.join(File::PATH_SEPARATOR) -#"#{File.expand_path(File.join(File.dirname(__FILE__)))}#{File::PATH_SEPARATOR}#{ENV['PATH']}" + Before do - @aruba_timeout_seconds = 60 + @aruba_timeout_seconds = 60 end \ No newline at end of file diff --git a/features/support/hooks.rb b/features/support/hooks.rb index 12bffdadc9..27f1d6c332 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -6,6 +6,6 @@ Before('@msfconsole') do # -- --=[ 0 payloads - 0 encoders - 0 nops ] end -Before('@target') do +Before('@targets') do step 'targets are loaded' end diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 0000000000..9b43886270 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,20 @@ +begin + require 'cucumber' + require 'cucumber/rake/task' + + + Cucumber::Rake::Task.new(:features) do |t| + t.cucumber_opts = 'features --format pretty' + t.profile = 'default' + end + + namespace :features do + Cucumber::Rake::Task.new(:boot) do |t| + t.profile = 'startup' + end + end + +rescue LoadError + puts "cucumber not in bundle, so can't set up feature tasks. " \ + "To run features ensure to install the development and test groups." +end