From 2e2f0f66bca252310be88f2fdd9c47a021da9291 Mon Sep 17 00:00:00 2001 From: Wade Alcorn Date: Mon, 16 Jan 2012 23:46:53 +1000 Subject: [PATCH] Re-added the loading of the unit test library --- Gemfile | 22 +++++++++++++--------- Gemfile.lock | 38 ++++++++++++++++++++++++++++++++++++++ Rakefile | 2 +- test/common/ts_common.rb | 14 +++++++------- 4 files changed, 59 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 89ab1cf6d..29c8dbabf 100644 --- a/Gemfile +++ b/Gemfile @@ -35,15 +35,19 @@ end # for the console shell extension gem "librex", "0.0.52" +if ENV['BEEF_TEST'] # for running unit tests -gem "msfrpc-client" -gem "curb" -gem "test-unit" -gem "selenium" -gem "selenium-webdriver" -# nokogirl is needed by capybara which may require one of the below commands -# sudo apt-get install libxslt-dev libxml2-dev -# sudo port install libxml2 libxslt -gem "capybara" + gem "test-unit" + gem "test-unit-full" + gem "msfrpc-client" + gem "curb" + gem "test-unit" + gem "selenium" + gem "selenium-webdriver" + # nokogirl is needed by capybara which may require one of the below commands + # sudo apt-get install libxslt-dev libxml2-dev + # sudo port install libxml2 libxslt + gem "capybara" +end source "http://rubygems.org" diff --git a/Gemfile.lock b/Gemfile.lock index 4feedf234..1cb001bba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,9 @@ GEM specs: addressable (2.2.6) ansi (1.4.1) + atk (1.0.3) + glib2 (>= 1.0.3) + cairo (1.10.1) capybara (1.1.2) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -31,7 +34,17 @@ GEM erubis (2.7.0) eventmachine (0.12.10) ffi (1.0.11) + gdk_pixbuf2 (1.0.3) + glib2 (>= 1.0.3) git (1.2.5) + glib2 (1.0.3) + pkg-config + gtk2 (1.0.3) + atk (>= 1.0.3) + gdk_pixbuf2 (>= 1.0.3) + pango (>= 1.0.3) + hoe (2.12.3) + rake (~> 0.8) jar_wrapper (0.1.2) jeweler jeweler @@ -50,11 +63,16 @@ GEM msgpack (0.4.6) multi_json (1.0.4) nokogiri (1.5.0) + pango (1.0.3) + cairo (>= 1.10.0) + glib2 (>= 1.0.3) parseconfig (0.5.2) + pkg-config (1.1.2) rack (1.4.0) rack-test (0.6.1) rack (>= 1.0) rake (0.9.2.2) + rr (1.0.4) rubyzip (0.9.5) selenium (0.2.2) jar_wrapper @@ -68,6 +86,25 @@ GEM rubyzip term-ansicolor (1.0.7) test-unit (2.4.3) + test-unit-full (0.0.3) + test-unit + test-unit-notify + test-unit-rr + test-unit-runner-fox + test-unit-runner-gtk2 + test-unit-runner-tk + test-unit-notify (0.3.0) + test-unit (>= 2.1.2) + test-unit-rr (1.0.1) + rr (>= 1.0.2) + test-unit (>= 2.1.2) + test-unit-runner-fox (0.0.1) + hoe (>= 1.6.0) + test-unit-runner-gtk2 (0.0.2) + gtk2 + test-unit + test-unit-runner-tk (0.0.1) + hoe (>= 1.6.0) thin (1.3.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -96,4 +133,5 @@ DEPENDENCIES selenium-webdriver term-ansicolor test-unit + test-unit-full thin diff --git a/Rakefile b/Rakefile index c4366f13f..af804db80 100644 --- a/Rakefile +++ b/Rakefile @@ -56,7 +56,7 @@ task :msf => ["install", "msf_install"] do end task :install do - sh "bundle install > /dev/null" + sh "export BEEF_TEST=true;bundle install > /dev/null" end ################################ diff --git a/test/common/ts_common.rb b/test/common/ts_common.rb index ce9d26596..b1a0a8b6e 100644 --- a/test/common/ts_common.rb +++ b/test/common/ts_common.rb @@ -22,11 +22,11 @@ if RUBY_VERSION < '1.9' exit end -#begin -# require 'test/unit/ui/console/testrunner' -#rescue LoadError -# puts "The following instruction failed: require 'test/unit/ui/console/testrunner'" -# puts "Please run: sudo gem install test-unit-full" -# exit -#end +begin + require 'test/unit/ui/console/testrunner' +rescue LoadError + puts "The following instruction failed: require 'test/unit/ui/console/testrunner'" + puts "Please run: sudo gem install test-unit-full" + exit +end