class Gauntlt::Runtime

Attributes

attack_files[RW]
format[RW]
outfile[RW]
path[RW]
tags[RW]

Public Class Methods

adapters_dir() click to toggle source
# File lib/gauntlt/runtime.rb, line 56
def adapters_dir
  File.join(base_dir, "attack_adapters")
end
attack_files_for(path) click to toggle source
# File lib/gauntlt/runtime.rb, line 48
def attack_files_for(path)
  path.split(' ').map{|p| Dir.glob(p)}.flatten
end
base_dir() click to toggle source
# File lib/gauntlt/runtime.rb, line 52
def base_dir
  File.expand_path( File.dirname(__FILE__) )
end
cuke_runtime(*args) click to toggle source
# File lib/gauntlt/runtime.rb, line 44
def cuke_runtime(*args)
  self.new(*args).cuke_runtime
end
new(path, tags=[], format="", outfile="") click to toggle source
# File lib/gauntlt/runtime.rb, line 14
def initialize(path, tags=[], format="", outfile="")
  self.path         = path
  self.attack_files = self.class.attack_files_for(path)
  self.tags         = tags
  self.format       = format
  self.outfile      = outfile
  raise NoFilesFound.new("No files found in path: #{path}") if attack_files.empty?
end

Public Instance Methods

cuke_cli() click to toggle source
# File lib/gauntlt/runtime.rb, line 23
def cuke_cli
  args =  attack_files + ['--strict', '--no-snippets', '--require', self.class.adapters_dir]
  args += ['--tags', tags] unless tags.empty?
  args += ['--format', format] unless format.nil?
  args += ['--out', outfile] unless outfile.nil?
  Cucumber::Cli::Main.new(args)
end
cuke_config() click to toggle source
# File lib/gauntlt/runtime.rb, line 31
def cuke_config
  cli.config
end
cuke_runtime() click to toggle source
# File lib/gauntlt/runtime.rb, line 35
def cuke_runtime
  Cucumber::Runtime.new(cuke_cli.configuration)
end
execute!() click to toggle source
# File lib/gauntlt/runtime.rb, line 39
def execute!
  cuke_cli.execute! 
end