Skip to content

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Apr 11, 2024

@mkllnk mkllnk self-assigned this Apr 11, 2024
mkllnk added 3 commits April 11, 2024 15:38
The specs are more important, so run them first. Runtime is pretty
similar at the moment.
@mkllnk mkllnk marked this pull request as ready for review April 11, 2024 05:51
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement 👍

Comment on lines +34 to +37
if expected.is_a?(Enumerator) && expected.inspect.match?(/:times>$/)
expected = expected.size
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking today that we should create a new object:

@matcher = QueryMatcher.new(@queries)
@matcher.matches?(expected)

That matcher would implement the different cases of comparing to different types. It would be easier to test that class and by storing it in an ivar, we can re-use it to print the error message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a good idea 👍

Copy link

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

@mkllnk mkllnk merged commit f65c9f3 into main Apr 15, 2024
@mkllnk mkllnk deleted the error-messages branch April 15, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants