-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Update matcher to take list of arguments; alias it as #strip_attributes #52
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.
Overall, looks great. Thank you. Just one small adjustment, please.
lib/strip_attributes/matchers.rb
Outdated
subject.send("#{@attribute}=", " string ") | ||
subject.valid? | ||
subject.send(@attribute) == "string" and collapse_spaces?(subject) | ||
end.all? |
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.
[PLEASE CHANGE] no need to pass over the array twice:
@attributes.all? do |attribute|
@attribute = attribute
subject.send("#{@attribute}=", " string ")
subject.valid?
subject.send(@attribute) == "string" and collapse_spaces?(subject)
end
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.
Good catch! Updated, and I also removed the extra unnecessary splats (*
)
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.
Would you like me to squash the commits into one, or is there an automatic way github can do that with the merge (I'm used to gitlab)?
Squashed and merged. Thank you! 🍻 |
v1.10.0 released with these changes! |
@rmm5t here's a PR for the issue I created: #51
I tried to match your style as much as possible, but please let me know if you'd like me to make any changes.