You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RSpec.describe"Contract"dosubject(:contract)doDry::Validation.Contractdoregister_macro(:foo)dokey.failure("not a foo")unlessvalue == "foo"endregister_macro(:bar)dokey.failure("not a bar")unlessvalue == "bar"endparamsdorequired(:test).array(:string)endrule(:test).each(:foo,:bar)endendit"validates each"dores=contract.call(test: ["foo","bar"])expect(res.errors.to_h).toeql(test: {0=>["not a bar"],1=>["not a foo"]})endend
This fails with error:
NoMethodError:
undefined method `flatten' for :foo:Symbol
Also when I change to rule(:test).each([:foo, :bar]) the result is not as expected as well:
Diff:
@@ -1,2 +1,2 @@
-:test => {0=>["not a bar"], 1=>["not a foo"]},
+:test => {1=>["not a foo"]},
The text was updated successfully, but these errors were encountered:
This fails with error:
Also when I change to
rule(:test).each([:foo, :bar])
the result is not as expected as well:The text was updated successfully, but these errors were encountered: