lib/pbt/check/runner_methods.rb in pbt-0.3.0 vs lib/pbt/check/runner_methods.rb in pbt-0.4.0
- old
+ new
@@ -112,11 +112,12 @@
runner.each_with_index do |val, index|
c = Case.new(val:, index:)
begin
property.run(val)
runner.handle_result(c)
- rescue => e
+ # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
+ rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
runner.handle_result(c)
break # Ignore the rest of the cases. Just pick up the first failure.
end
end
@@ -160,11 +161,12 @@
require_parallel
Parallel.map_with_index(runner, in_threads: Parallel.processor_count) do |val, index|
Case.new(val:, index:).tap do |c|
property.run(val)
- rescue => e
+ # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
+ rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
# It's possible to break this loop here by raising `Parallel::Break`.
# But if it raises, we cannot fetch all cases' result. So this loop continues until the end.
end
end.each do |c|
@@ -181,10 +183,11 @@
require_parallel
Parallel.map_with_index(runner, in_processes: Parallel.processor_count) do |val, index|
Case.new(val:, index:).tap do |c|
property.run(val)
- rescue => e
+ # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
+ rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
# It's possible to break this loop here by raising `Parallel::Break`.
# But if it raises, we cannot fetch all cases' result. So this loop continues until the end.
end
end.each do |c|