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

Add type support for Faker::Types.rb_array #2771

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

ruban-thilak
Copy link
Contributor

@ruban-thilak ruban-thilak commented May 30, 2023

Motivation / Background

This Pull Request has been created because Faker::Types.rb_hash supports the type argument but Faker::Types.rb_array doesn't. Introducing this will allow the developers to test with an array of one single type.

i.e: Array of strings or Array of hash

Faker::Types.rb_array(len: 2, type: -> { Faker::Types.rb_string }) 
#=> ["cat", "foo"]

Faker::Types.rb_array(len: 3, type: -> { Faker::Types.rb_hash }) 
#=> [{:sit=>67}, {:quis=>"quis"}, {:excepturi=>92}]

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • Tests and Rubocop are passing before submitting your proposed changes.

Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

nice, thank you!

@ruban-thilak
Copy link
Contributor Author

@thdaraujo Have fixed the Flaky spec - #2782

@thdaraujo thdaraujo merged commit 4558f1b into faker-ruby:main Jun 19, 2023
7 checks passed
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