Skip to content

Commit

Permalink
Make Rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fractaledmind committed Nov 2, 2024
1 parent 54de83e commit 386d89c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/job_crucible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def run(&callback)

def permutations
callstack = capture_callstack.to_a
error_locations = callstack.map { |key, desc| ["before", key, desc] }.concat [["after"] + callstack.last]
error_locations = callstack.map { |key, desc| ["before", key, desc] }.push ["after"] + callstack.last
error_locations.permutation(@depth)
end

Expand Down
6 changes: 5 additions & 1 deletion test/crucibles/delaying_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def do_something
assert_equal false, AcidicJob::Value.find_by(key: "halt").value

job_that_performed = Performance.all.first

assert_in_delta Time.parse(job_that_performed["scheduled_at"]).to_i, 14.days.from_now.to_i
end

Expand Down Expand Up @@ -133,7 +134,9 @@ def do_something
test "scenario with error before halt_step!" do
Job.retry_on JobCrucible::RetryableError
scenario = JobCrucible::Scenario.new
scenario.before(__FILE__ + ":31") { raise JobCrucible::RetryableError }
scenario.before("#{__FILE__}:31") do
raise JobCrucible::RetryableError
end
scenario.enable do
Job.perform_later
window = 1.minute.from_now
Expand Down Expand Up @@ -199,6 +202,7 @@ def do_something
assert_equal false, AcidicJob::Value.find_by(key: "halt").value

job_that_performed = Performance.all.first

assert_in_delta Time.parse(job_that_performed["scheduled_at"]).to_i, 14.days.from_now.to_i
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DefaultsError < StandardError; end
class DiscardableError < StandardError; end
class BreakingError < StandardError; end

class ActiveSupport::TestCase
class ActiveSupport::TestCase # rubocop:disable Style/ClassAndModuleChildren
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)

Expand All @@ -65,4 +65,4 @@ def before_setup
end

def after_teardown; end
end
end

0 comments on commit 386d89c

Please sign in to comment.