-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b33ba82
commit 20d8cb0
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
describe UberTask::SkipTask do | ||
it 'Skips the task on a error' do | ||
task_skipped_after_exception = false | ||
|
||
UberTask.run do | ||
UberTask.on_subtask_error do |_task, _event, err| | ||
if err.message == 'Some error' | ||
task_skipped_after_exception = true | ||
UberTask.skip(reason: err) | ||
end | ||
end | ||
|
||
UberTask.run do | ||
raise 'Some error' if task_skipped_after_exception == false | ||
end | ||
end | ||
|
||
expect(task_skipped_after_exception).to be(true) | ||
end | ||
end |