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

Fixes a bug when generating a password with min_length eq 1 #2138

Merged
merged 3 commits into from
Oct 2, 2020

Conversation

adrian-rivera
Copy link
Contributor

Issue#

#1770

Description:

As describe on #1770 running a command like this:

>> Faker::Internet.password min_length: 1, max_length: 3
ArgumentError (min_alpha + min_numeric must be <= number)
	from (irb):2

caused an error, the root cause is the parameter min_length, which raises an argument error when mix_case is set to true.

With this fix setting min_length to 1 won't cause this exception.

@adrian-rivera adrian-rivera force-pushed the fix_1770 branch 3 times, most recently from c14ca82 to b5e2266 Compare October 2, 2020 17:05
Copy link
Contributor

@Zeragamba Zeragamba left a comment

Choose a reason for hiding this comment

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

swapped the full if for brackets as that looks a bit nicer. All changes look good to me. :)

Oh... that ticks off Rubocop. Nvm. Reverting back to the original version
@Zeragamba Zeragamba merged commit 4f11760 into faker-ruby:master Oct 2, 2020
@Zeragamba
Copy link
Contributor

Thanks!

@adrian-rivera adrian-rivera deleted the fix_1770 branch October 2, 2020 17:55
droznyk pushed a commit to droznyk/faker that referenced this pull request Oct 23, 2020
…by#2138)

* Fixes a bug when generating passwords with min_length eq 1

* swap if block for brackets

* Update internet.rb

Oh... that ticks off Rubocop. Nvm. Reverting back to the original version

Co-authored-by: Stephen A. Wilson <stephen-356@hotmail.com>
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
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