Module: Sapphire::DSL::TestPlans

Included in:
Sapphire
Defined in:
lib/sapphire/DSL/TestPlans/Run.rb,
lib/sapphire/DSL/TestPlans/TestPlan.rb,
lib/sapphire/DSL/TestPlans/Parameter.rb,
lib/sapphire/DSL/TestPlans/FileHandler.rb,
lib/sapphire/DSL/TestPlans/PathHandler.rb

Defined Under Namespace

Classes: FileHandler, Parameters, PathHandler, TestPlan

Instance Method Summary collapse

Instance Method Details

#Parameter(item) ⇒ Object



5
6
7
8
# File 'lib/sapphire/DSL/TestPlans/Parameter.rb', line 5

def Parameter(item)
  Parameters.instance.Add(item) if item.is_a? Hash
  return Parameters.instance.Get(item) if item.is_a? Symbol
end

#Run(item) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sapphire/DSL/TestPlans/Run.rb', line 4

def Run(item)
  if(item.is_a? Job)
    job = item
    if(job.Arg)
      @command = job.Path + " " + job.Arg.to_s
    else
      @command = job.Path
    end


    psCommand = "& icm " + job.Server + " {" + @command + "}"
    psCommand = "powershell -inputformat none -command \"& {" + psCommand + "} \""
    puts ""
    puts ""
    puts "executing your job via powershell command: " + psCommand
    system psCommand
    puts ""
    puts ""

  else
    Runner.instance.last_test_plan.Add(item)
  end
end

#TestPlan(text, &block) ⇒ Object



5
6
7
# File 'lib/sapphire/DSL/TestPlans/TestPlan.rb', line 5

def TestPlan(text, &block)
  Runner.instance.add_test_plan(TestPlan.new(text, &block))
end