Open shepmaster opened 1 year ago
In CI I see two failures:
1) Failure:
without Type With Nilify#test_0001_raise error for new dry-types v - work as expected for older versions [/home/runner/work/disposable/disposable/test/twin/coercion_test.rb:138]:
Dry::Types::CoercionError expected but nothing was raised.
2) Failure:
CoercionTypingTest#test_0001_anonymous [/home/runner/work/disposable/disposable/test/twin/coercion_test.rb:184]:
Dry::Types::ConstraintError expected but nothing was raised.
By always adding that "soft block" we apparently changed expected behavior, need to check out what's the best way to do this.
thanks for this PR! :green_heart:
dry-types 0.15 and 1.x changed how failed coercions are reported. Older versions returned the original value while newer versions raise an exception.
0.14.1:
1.7.1:
Fortunately, the constructor accepts an optional block:
Doubly-fortunately, the block appears to be ignored on older versions of dry-types.
To preserve the current behavior, we update to use a block that returns the original value.