Class: Tumugi::Test::TumugiTestCase

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/tumugi/test/helper.rb

Instance Method Summary collapse

Instance Method Details

#assert_run_fail(workflow_file, task, options = {}) ⇒ Object



29
30
31
32
33
# File 'lib/tumugi/test/helper.rb', line 29

def assert_run_fail(workflow_file, task, options={})
  assert_raise(Thor::Error) do
    invoke(:run_, workflow_file, task, options)
  end
end

#assert_run_success(workflow_file, task, options = {}) ⇒ Object



25
26
27
# File 'lib/tumugi/test/helper.rb', line 25

def assert_run_success(workflow_file, task, options={})
  assert_true(invoke(:run_, workflow_file, task, { workers: 2 }.merge(options)))
end

#assert_show_fail(workflow_file, task, options = {}) ⇒ Object



39
40
41
42
43
# File 'lib/tumugi/test/helper.rb', line 39

def assert_show_fail(workflow_file, task, options={})
  assert_raise(Thor::Error) do
    invoke(:show, workflow_file, task, options)
  end
end

#assert_show_success(workflow_file, task, options = {}) ⇒ Object



35
36
37
# File 'lib/tumugi/test/helper.rb', line 35

def assert_show_success(workflow_file, task, options={})
  assert_true(invoke(:show, workflow_file, task, options))
end

#invoke(command, workflow_file, task, options) ⇒ Object



21
22
23
# File 'lib/tumugi/test/helper.rb', line 21

def invoke(command, workflow_file, task, options)
  Tumugi::CLI.new.invoke(command, [task], { file: workflow_file, quiet: true }.merge(options))
end