Maybe I’m taking crazy pills, but I thought dry-transaction used to detect Non-Exhaustive matches if you failed to include a matcher for a particular step.
class MyTransaction
include Dry::Transaction
step :one
def one
Failure("error")
end
end
This raises like I’d expect:
MyTransaction.new.call do |on|
on.success { |v| p "Success: #{v}" }
end
…/dry-matcher-0.10.0/lib/dry/matcher/evaluator.rb:64:in `ensure_exhaustive_match’: cases +failure+ not handled (Dry::Matcher::NonExhaustiveMatchError)
I was expecting the same from this, but it’s perfectly happy:
MyTransaction.new.call do |on|
on.success { |v| p "Success: #{v}" }
on.failure(:two) { |err| p "Failure Two: #{err}" }
end
Is this a regression, or am I mis-remembering that this behavior ever existed?