dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

Explicitly support for nil input in format? #67

Closed flash-gordon closed 5 years ago

flash-gordon commented 5 years ago

Ruby 2.7-preview2 raises an error when Regexp#match? receives nil, this breaks a few tests in dry-schema. This change in ruby was already reverted but may be re-introduced in the future. See discussions: https://bugs.ruby-lang.org/issues/13083

This also fixes tests, they were wrong from the beginning.

Finally, it's not recommended to rely on this behavior. The nil check may be removed in future major versions, it's only added to make tests in dry-schema pass.