-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixes tests and updates dry validation version #2
Fixes tests and updates dry validation version #2
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.
A couple questions for you. I'm guessing the change was necessitated due to updating the dry-validation version?
@@ -164,7 +164,7 @@ def define_assurances_hook | |||
|
|||
after do | |||
assurances = self.class.assurances.new | |||
result = assurances.call(context) | |||
result = assurances.call(context.to_h) |
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.
Was this throwing an error? Since the Interactor::Context
object is based on OpenStruct
, it used to be handled automatically by dry-validation
. I would rather rely on dry-validation
's handling of OpenStruct
s if possible.
I'm guessing it was due to how the required
macro works?
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.
Yes, when I started testing it it was raising a NoMethodError: undefined method
key?' for, it seems dry-validation started checking for keys using
#key?` method which doesn't exist in OpenStruct neither Context.
@@ -189,7 +189,7 @@ def define_expectations_hook | |||
|
|||
before do | |||
expectations = self.class.expectations.new | |||
result = expectations.call(context) | |||
result = expectations.call(context.to_h) |
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.
Same as above with the other call to #to_h
.
require "codeclimate-test-reporter" | ||
CodeClimate::TestReporter.start | ||
require 'simplecov' | ||
SimpleCov.start |
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.
We should get the codeclimate-test-reporter
to work again, but that's outside the scope of this right now.
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.
This looks good. I'm not a big fan of having to explicitly dump the Context to a Hash, but it seems like what we're going to have to do for the time being.
Thanks for the contribution!
I tried to use this project and ended up getting some errors, I started investigating the causes and noticed the dry validation used was old, and there were some errors in spec_helper (related to SimpleCov configuring).