class Object

Public Instance Methods

def_macro(name, *args, &block)
Alias for: define_macro
define_macro(name, *args, &block) click to toggle source

Define macro. That's a name to predefined target-run-expect evaluation. @param name (String) macro name @param block (Block) macro code

# File lib/teuton/case_manager/dsl.rb, line 20
def define_macro(name, *args, &block)
  Application.instance.macros[name] = { args: args, block: block }
end
Also aliased as: def_macro, defmacro
defmacro(name, *args, &block)
Alias for: define_macro
group(name, &block) click to toggle source

Define a group of tests @param name (String) Group name @param block (Block) Tests code

# File lib/teuton/case_manager/dsl.rb, line 29
def group(name, &block)
  Application.instance.groups << { name: name, block: block }
end
Also aliased as: task, task, task
play(&block) click to toggle source

Start test @param block (Block) Extra code executed at the end.

# File lib/teuton/case_manager/dsl.rb, line 36
def play(&block)
  CaseManager.instance.play(&block)
end
Also aliased as: start
start(&block)
Also aliased as: play, play
Alias for: play
task(name, &block)
Alias for: group
use(filename) click to toggle source

Define filename to be used into our test @param filename (String) Filename to be required

# File lib/teuton/case_manager/dsl.rb, line 6
def use(filename)
  filename += '.rb'
  app = Application.instance
  rbfiles = File.join(app.project_path, "**", filename)
  files = Dir.glob(rbfiles)
  findfiles = []
  files.sort.each { |f| findfiles << f if f.include?(filename) }
  require_relative findfiles.first
  app.uses << File.basename(findfiles.first)
end