Skip to content

Commit

Permalink
Increase code coverage (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrinlopes authored Jul 31, 2024
1 parent b33ba82 commit 20d8cb0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
22 changes: 22 additions & 0 deletions spec/non_rails/uber_task/task_skipped_on_error_spec.rb
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

0 comments on commit 20d8cb0

Please sign in to comment.