Skip to content
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

Refactor the 'I should see the number' step #100

Merged
merged 1 commit into from
Jun 14, 2019
Merged

Conversation

makmic
Copy link
Member

@makmic makmic commented Jun 13, 2019

  • It can now be composed with the 'within' step
  • It can now truly match negative numbers
  • It dropped the hidden dependency on the HTMLEntities gem
  • It is now tested

Fixes Issues #43 and #44.

Please note that I had to switch from page.body to page.text, since the former is not affected by the scope that was created by a within step.

@makmic makmic requested a review from judithroth June 13, 2019 07:49
nbsp = " "
"( |#{nbsp})(#{unit})"
else
word_boundary
Copy link
Contributor

Choose a reason for hiding this comment

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

It's just a minor thing but I don't see the value of using a variable here. I guess it is a leftover of changing things. I would prefer to have the '\b' directly in the else clause.

expectation = negate ? :not_to : :to
expect_to_match = negate ? :not_to : :to
amount_included_minus = amount.gsub!(/^-/, '')
expect_minus = amount_included_minus ? '-' : '(?:[^\\-]|^)'
Copy link
Contributor

Choose a reason for hiding this comment

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

'(?:[^\\-]|^)' what is the added |^ for?

@judithroth
Copy link
Contributor

Overall I really like what you did, good job! I made some comments - if you want to we can talk about those.

* It can now be composed with the 'within' step
* It can now truly match negative numbers
* It dropped the hidden dependency on the HTMLEntities gem
* It is now tested
@makmic makmic force-pushed the ml/update-see-the-amount branch from 26b4542 to ebce7b9 Compare June 14, 2019 08:43
@makmic makmic merged commit d386a85 into master Jun 14, 2019
@FLeinzi FLeinzi deleted the ml/update-see-the-amount branch February 9, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants