-
Notifications
You must be signed in to change notification settings - Fork 60
updates specs #1
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
base: master
Are you sure you want to change the base?
Conversation
spec/features/calculations_spec.rb
Outdated
| it "creates an appropriately constrained random number", points: 1, hint: h("exclusive_random_numbers") do | ||
| visit "/flexible/random/1/10" | ||
|
|
||
| reg_exp = /A random number between 1 and 10 is (\d+)/ |
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.
Perhaps naming reg_exp something like pattern?
|
|
||
| reg_exp = /A random number between 1 and 10 is (\d+)/ | ||
| matched_groups = reg_exp.match(page.text) | ||
| first_matched_number = matched_groups[1].to_i |
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.
Can we call #second here rather than #[1]?
If not, can we do .at(1)?
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.
Unfortunately, need to stick with [] syntax
spec/features/calculations_spec.rb
Outdated
| reg_exp = /A random number between 1 and 10 is (\d+)/ | ||
| matched_groups = reg_exp.match(page.text) | ||
| first_matched_number = matched_groups[1].to_i | ||
| expect(first_matched_number).to be > 1 |
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.
Do we need to check (either here or in a separate spec) that it's also less than 10?
|
LGTM |
Just need a once-over to make sure we're on the same page with naming conventions and that the flexible random numbers specs are readable enough.