Class: Sapphire::DSL::TestPlans::FileHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/sapphire/DSL/TestPlans/FileHandler.rb

Instance Method Summary collapse

Instance Method Details

#Handle(item) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sapphire/DSL/TestPlans/FileHandler.rb', line 5

def Handle(item)
  x = ""
  x = AppConfig.Current.SpecsPath if AppConfig.Current and AppConfig.Current.SpecsPath
  file = File.expand_path(item, __FILE__)
  file = File.expand_path(x + item, __FILE__) if !File.exists?(file)
  file = File.expand_path(File.dirname(__FILE__) + item) if !File.exists?(file)
  raise "File Not Found: " + item if !File.exists?(file)
  load file if File.exists?(file)
  Runner.instance.last_scenario.file_name = item if Runner.instance.last_scenario and Runner.instance.last_scenario.file_name == ""
  Runner.instance.last_scenario.execute
end