-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Faker::Finance.vat_number (#1348)
* Add Faker::Finance.vat_number, its tests and docs * Update changelog * Add tests and reorder locales * Minor changes * Update test_faker_finance.rb * Minor change
- Loading branch information
Showing
6 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestFakerFinance < Test::Unit::TestCase | ||
def setup | ||
Faker::Config.locale = nil | ||
end | ||
|
||
def test_vat_number | ||
assert Faker::Finance.vat_number.match(/\w+/) | ||
end | ||
|
||
def test_vat_number_with_invalid_params | ||
assert_raise ArgumentError do | ||
Faker::Finance.vat_number(Faker::Lorem.word) | ||
end | ||
end | ||
|
||
def test_vat_number_with_valid_params | ||
Faker::Finance.vat_number_keys.each do |country| | ||
assert Faker::Finance.vat_number(country).match(/\w+/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters