-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
I'm writing a custom rspec matcher that validates the input and output arguments that are being stubbed out obey the specified contract. I'm doing this by calling Contract.valid? against the contract after pulling it using decorated_methods_for. The documentation for #valid? says that it returns metadata about the nature of the failure, but I am getting nil. I'd like the matcher to just raise the original ParamContractError when there is an error, which I'm doing by just re-calling the original method, but I'd prefer to just surface the contract failure up front explicitly.
Better yet, I'd like to just do Contract.validate!(args, contract) but this doesn't seem to be a public API. Was wondering if I could get some help with this!
Metadata
Metadata
Assignees
Labels
No labels