Skip to content

Conversation

@arjunvenkat
Copy link
Contributor

@arjunvenkat arjunvenkat commented Jan 29, 2018

  • Updates the naming conventions of all specs
  • Adds new specs for flexible random numbers
  • Adds hint for flexible random numbers

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.

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+)/
Copy link
Contributor

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
Copy link
Contributor

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)?

Copy link
Contributor Author

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

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
Copy link
Contributor

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?

@raghubetina
Copy link
Contributor

LGTM

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.

3 participants