lib/oats/driver.rb in oats-0.0.2 vs lib/oats/driver.rb in oats-0.0.3

- old
+ new

@@ -3,12 +3,10 @@ require 'oats/application_logs' require 'oats/oats_data' require 'oats/roptions' require 'oats/build_id' -autoload :Spreadsheet, 'spreadsheet' - module Oats module Driver def Driver.agent @@ -43,11 +41,11 @@ # Main method that starts oats execution in either agent or standalone mode. # Parameters are command-line arguments # Returns oats_info object containing execution results def Driver.run(args) unless ENV['HOSTNAME'] - if RUBY_PLATFORM =~ /mswin32/ + if RUBY_PLATFORM =~ /(mswin|mingw)/ ENV['HOSTNAME'] = ENV['COMPUTERNAME'] else ENV['HOSTNAME'] = `hostname`.chomp end end @@ -444,9 +442,10 @@ end # Return all the included worksheet lists in XL and place all # their test arrays in $oats_global['xl'] def Driver.parse_xl(path,id) + require 'spreadsheet' unless defined?(Spreadsheet) book = Spreadsheet.open path sheet = book.worksheet 'Main' Oats.assert sheet, "Could not locate worksheet 'Main' in: " + path list = Driver.xl_sheet_tests(sheet, id, 'Main', 'Test_Scenarios') Oats.assert !list.empty?, "No executable worksheets are listed in Main worksheet in: " + path \ No newline at end of file