Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Brazilian documents generation and documentation #1495

Merged
merged 27 commits into from
Aug 11, 2019
Merged

Add Brazilian documents generation and documentation #1495

merged 27 commits into from
Aug 11, 2019

Conversation

lucasqueiroz
Copy link
Member

This Pull Request closes the issue #1208.
For this generation, I used the #1382 checksum generator (I separated it into two methods so it can be reused, added documentation and an alias).
It generates a valid Brazilian ID based on SSP rules.

@lucasqueiroz
Copy link
Member Author

I noticed the tests are a bit messy. Maybe it could have a test for the checksum methods so it validates the algorithm and another one for the generator, validating it generates a random value with the correct amount of digits + format

@lucasqueiroz
Copy link
Member Author

I have refactored the tests so it doesn't require the checksum calculation inside the generator tests.

@dainmiller
Copy link

Love this. Bumping to see if it can get merged - was going to make a similar change myself.

@vbrazo vbrazo force-pushed the master branch 3 times, most recently from 69291b2 to 5cc660c Compare July 5, 2019 17:21
@vbrazo
Copy link
Member

vbrazo commented Jul 9, 2019

@lucasqueiroz could you fix the merge issues? I'd like to include this PR in version 2. Thanks 👍

@lucasqueiroz
Copy link
Member Author

Sure, will take a look at it asap!

Merge stympy/faker into lucasqueiroz/faker
@lucasqueiroz
Copy link
Member Author

Hi @vbrazo, I have fixed the conflicts and added the RG generator to the ID documentation.

Please let me know if there is any change required.

Thanks!

@vbrazo vbrazo merged commit ea3a059 into faker-ruby:master Aug 11, 2019
michebble pushed a commit to michebble/faker that referenced this pull request Feb 16, 2020
* Change default parameter format in brazilian_citizen_number

* Add alias to brazilian_citizen_number

* Add Brazilian ID generator

* Change generator for Brazilian ID number
Add alias for Brazilian ID number

* Add docs for Brazilian Citizen Number (CPF)

* Add docs for Brazilian ID (RG)

* Add tests for brazilian id digit

* Remove if statement from brazilian id digit method

* Refactor brazilian_document_remainder and rename it to brazilian_document_digit

* Add tests for brazilian_citizen_number_digit

* Add tests for brazilian_document_digit

* Add tests for brazilian_document_checksum

* Add tests for brazilian_id_checksum_digit

* Add tests for brazilian_citizen_number_checksum_digit

* Simplify brazilian document tests

* Add Brazilian ID (RG) to ID Number docs

* Minor changes

* Remove unused file

* Minor fixes

* Readd docs after deleting unreleased docs folder

* docs
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Change default parameter format in brazilian_citizen_number

* Add alias to brazilian_citizen_number

* Add Brazilian ID generator

* Change generator for Brazilian ID number
Add alias for Brazilian ID number

* Add docs for Brazilian Citizen Number (CPF)

* Add docs for Brazilian ID (RG)

* Add tests for brazilian id digit

* Remove if statement from brazilian id digit method

* Refactor brazilian_document_remainder and rename it to brazilian_document_digit

* Add tests for brazilian_citizen_number_digit

* Add tests for brazilian_document_digit

* Add tests for brazilian_document_checksum

* Add tests for brazilian_id_checksum_digit

* Add tests for brazilian_citizen_number_checksum_digit

* Simplify brazilian document tests

* Add Brazilian ID (RG) to ID Number docs

* Minor changes

* Remove unused file

* Minor fixes

* Readd docs after deleting unreleased docs folder

* docs
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants