-
-
Notifications
You must be signed in to change notification settings - Fork 115
Add error message to respond_to? predicate #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this makes sense. Any chance you could create a simple spec under spec/integration/schema/predicates/respond_to_spec.rb?
31b7598
to
7cd0c1c
Compare
@solnic I've added tests but I managed to test only macro-way, as I found a bug It looks like defining schema passing predicate directly to require/optional is broken
My guess is that I've skipped failing tests, although I'm not sure what should be done with that bug |
Correct. If you add |
@solnic I've added undef in the dsl, tests are green on MRI, but some fail on jruby (others than what I added) |
thanks, this is confusing - I need to debug this under jruby :( The truth is, we should replace |
This doesn't really change much but fixes a subtle issue with jruby found in dry-rb/dry-schema#348 It's hard to say whether it's a bug in jruby because it's an intersection of `undef :respond_to?`, `BasicObject` and implicit coercion to keywords. Keywords situation will improve over time so I think jruby shouldn't bother fixing this particular case.
I'll cut a minor release in dry-logic, this should fix jruby failures dry-rb/dry-logic#85 |
This was not reported on https://discourse.dry-rb.org/, though I think it can be treated as "typo", thus just straight PR:
When using Types.Interface, error is not produced in the
Dry::Schema::Result
Ex.
The reason behind that is because errors message compiler can't find translation:
Expected:
Adding a translation to
respond_to?
fixes the above issue