JEG2 / highline

A higher level command-line oriented interface.
Other
1.29k stars 137 forks source link

Fix agree validation to only accept "yes" or "no" #189

Closed kevinoid closed 8 years ago

kevinoid commented 8 years ago

Although the documentation for agree states that it only accepts yes/no/y/n case-insensitively, the Regexp allowed any string which started with /y/i or ended with /no?/i and interpreted any starting with 'y' as true. This PR fixes the Regexp to properly exclude the start and end markers from the alternation and add a test value to confirm it works.

Thanks for considering, Kevin

abinoam commented 8 years ago

Hi @kevinoid ,

Good catch!

I'll try to improve the tests and merge.

abinoam commented 8 years ago

Hi @kevinoid,

Could cherry-pick the commit with tests that I have added/improved so we merge everything altogether?

fed5fac748a97ef3f929941912

git fetch --all
git checkout fix-ask-checking
git cherry-pick fed5fac748a97ef3f929941912
git push
kevinoid commented 8 years ago

Sure thing. Thanks for the quick review and additional work on it!

abinoam commented 8 years ago

Thanks @kevinoid . Merging it!