Module: GitWorkflow::Callbacks::TestCodeSupport

Defined in:
lib/git_workflow/callbacks/test_code_support.rb

Constant Summary collapse

Failure =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#run_tests!(*rake_test_tasks) ⇒ Object



6
7
8
# File 'lib/git_workflow/callbacks/test_code_support.rb', line 6

def run_tests!(*rake_test_tasks)
  run_tests(*rake_test_tasks) or raise Failure, 'The tests failed, please fix and try again'
end

#run_tests_with_recovery!(*rake_test_tasks) ⇒ Object



10
11
12
13
14
# File 'lib/git_workflow/callbacks/test_code_support.rb', line 10

def run_tests_with_recovery!(*rake_test_tasks)
  until run_tests(*rake_test_tasks)
    spawn_shell_for_recovery or raise Failure, 'The tests failed. Please fix and then "git push origin master"'
  end
end