ffaker 1.32.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +35 -23
- data/README.md +3 -3
- data/Rakefile +20 -0
- data/ffaker.gemspec +2 -2
- data/lib/ffaker.rb +2 -2
- data/lib/ffaker/address.rb +9 -9
- data/lib/ffaker/address_au.rb +3 -3
- data/lib/ffaker/address_br.rb +3 -3
- data/lib/ffaker/address_ca.rb +3 -3
- data/lib/ffaker/address_da.rb +3 -3
- data/lib/ffaker/address_de.rb +3 -3
- data/lib/ffaker/address_fi.rb +4 -4
- data/lib/ffaker/address_fr.rb +5 -5
- data/lib/ffaker/address_mx.rb +3 -3
- data/lib/ffaker/address_nl.rb +3 -3
- data/lib/ffaker/address_se.rb +4 -4
- data/lib/ffaker/address_sn.rb +2 -2
- data/lib/ffaker/address_uk.rb +3 -3
- data/lib/ffaker/address_us.rb +3 -3
- data/lib/ffaker/bacon_ipsum.rb +1 -1
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/color.rb +1 -1
- data/lib/ffaker/company.rb +1 -1
- data/lib/ffaker/company_it.rb +1 -1
- data/lib/ffaker/company_se.rb +1 -1
- data/lib/ffaker/conference.rb +1 -1
- data/lib/ffaker/courses.rb +1 -1
- data/lib/ffaker/currency.rb +1 -1
- data/lib/ffaker/dizzle_ipsum.rb +1 -1
- data/lib/ffaker/education.rb +1 -1
- data/lib/ffaker/food.rb +1 -1
- data/lib/ffaker/gender.rb +1 -1
- data/lib/ffaker/gender_cn.rb +1 -1
- data/lib/ffaker/gender_kr.rb +1 -1
- data/lib/ffaker/geolocation.rb +1 -1
- data/lib/ffaker/guid.rb +2 -2
- data/lib/ffaker/healthcare_ipsum.rb +1 -1
- data/lib/ffaker/hipster_ipsum.rb +1 -1
- data/lib/ffaker/html_ipsum.rb +9 -9
- data/lib/ffaker/identification.rb +3 -3
- data/lib/ffaker/identification_es.rb +1 -1
- data/lib/ffaker/identification_es_cl.rb +1 -1
- data/lib/ffaker/identification_es_co.rb +2 -2
- data/lib/ffaker/identification_mx.rb +1 -1
- data/lib/ffaker/internet.rb +2 -2
- data/lib/ffaker/internet_se.rb +2 -2
- data/lib/ffaker/job.rb +1 -1
- data/lib/ffaker/job_fr.rb +1 -1
- data/lib/ffaker/job_ja.rb +1 -1
- data/lib/ffaker/job_kr.rb +1 -1
- data/lib/ffaker/locale.rb +1 -1
- data/lib/ffaker/lorem.rb +1 -1
- data/lib/ffaker/lorem_ar.rb +1 -1
- data/lib/ffaker/lorem_cn.rb +1 -1
- data/lib/ffaker/lorem_fr.rb +1 -1
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/movie.rb +7 -7
- data/lib/ffaker/name.rb +1 -1
- data/lib/ffaker/name_br.rb +1 -1
- data/lib/ffaker/name_cn.rb +1 -1
- data/lib/ffaker/name_cs.rb +6 -6
- data/lib/ffaker/name_da.rb +2 -2
- data/lib/ffaker/name_de.rb +2 -2
- data/lib/ffaker/name_fr.rb +1 -1
- data/lib/ffaker/name_ga.rb +1 -1
- data/lib/ffaker/name_it.rb +1 -1
- data/lib/ffaker/name_ja.rb +1 -1
- data/lib/ffaker/name_kr.rb +1 -1
- data/lib/ffaker/name_mx.rb +2 -2
- data/lib/ffaker/name_nb.rb +2 -2
- data/lib/ffaker/name_nl.rb +2 -2
- data/lib/ffaker/name_ph.rb +2 -2
- data/lib/ffaker/name_ru.rb +7 -7
- data/lib/ffaker/name_se.rb +2 -2
- data/lib/ffaker/name_sn.rb +1 -1
- data/lib/ffaker/name_th.rb +1 -1
- data/lib/ffaker/name_vn.rb +1 -1
- data/lib/ffaker/nato_alphabet.rb +1 -1
- data/lib/ffaker/phone_number.rb +3 -3
- data/lib/ffaker/phone_number_au.rb +7 -7
- data/lib/ffaker/phone_number_cu.rb +12 -14
- data/lib/ffaker/phone_number_da.rb +3 -3
- data/lib/ffaker/phone_number_de.rb +4 -4
- data/lib/ffaker/phone_number_fr.rb +3 -3
- data/lib/ffaker/phone_number_it.rb +2 -2
- data/lib/ffaker/phone_number_kr.rb +3 -3
- data/lib/ffaker/phone_number_mx.rb +7 -7
- data/lib/ffaker/phone_number_nl.rb +5 -5
- data/lib/ffaker/phone_number_se.rb +5 -5
- data/lib/ffaker/phone_number_sg.rb +9 -9
- data/lib/ffaker/phone_number_sn.rb +5 -5
- data/lib/ffaker/product.rb +1 -1
- data/lib/ffaker/skill.rb +1 -1
- data/lib/ffaker/ssn.rb +2 -2
- data/lib/ffaker/ssn_mx.rb +7 -7
- data/lib/ffaker/ssn_se.rb +1 -1
- data/lib/ffaker/string.rb +1 -1
- data/lib/ffaker/time.rb +1 -1
- data/lib/ffaker/unit.rb +1 -1
- data/lib/ffaker/unit_english.rb +2 -2
- data/lib/ffaker/unit_metric.rb +2 -2
- data/lib/ffaker/utils/array_utils.rb +1 -1
- data/lib/ffaker/utils/module_utils.rb +3 -3
- data/lib/ffaker/vehicle.rb +3 -3
- data/lib/ffaker/venue.rb +1 -1
- data/scripts/benchmark.rb +2 -2
- data/scripts/profiling.rb +1 -1
- data/test/test_address.rb +21 -21
- data/test/test_address_au.rb +17 -17
- data/test/test_address_br.rb +7 -7
- data/test/test_address_ca.rb +4 -4
- data/test/test_address_da.rb +9 -9
- data/test/test_address_de.rb +5 -5
- data/test/test_address_fi.rb +6 -6
- data/test/test_address_mx.rb +5 -5
- data/test/test_address_nl.rb +1 -1
- data/test/test_address_se.rb +6 -6
- data/test/test_address_sn.rb +4 -4
- data/test/test_address_uk.rb +3 -3
- data/test/test_address_us.rb +7 -7
- data/test/test_array_utils.rb +1 -1
- data/test/test_bacon_ipsum.rb +6 -6
- data/test/test_boolean.rb +1 -1
- data/test/test_color.rb +1 -1
- data/test/test_company.rb +6 -6
- data/test/test_company_it.rb +4 -4
- data/test/test_company_se.rb +2 -2
- data/test/test_conference.rb +1 -1
- data/test/test_course_mathematiques.rb +1 -1
- data/test/test_course_philosophie.rb +1 -1
- data/test/test_dizzle_ipsum.rb +6 -6
- data/test/test_education.rb +1 -1
- data/test/test_faker.rb +6 -6
- data/test/test_food.rb +4 -4
- data/test/test_gender.rb +1 -1
- data/test/test_gender_cn.rb +1 -1
- data/test/test_gender_kr.rb +1 -1
- data/test/test_geolocation.rb +3 -3
- data/test/test_guid.rb +1 -1
- data/test/test_healthcare_ipsum.rb +6 -6
- data/test/test_hipster_ipsum.rb +6 -6
- data/test/test_html_ipsum.rb +19 -19
- data/test/test_identification.rb +1 -1
- data/test/test_identification_co.rb +1 -1
- data/test/test_identification_es.rb +1 -1
- data/test/test_identification_es_cl.rb +1 -1
- data/test/test_identification_es_mx.rb +7 -7
- data/test/test_internet.rb +1 -1
- data/test/test_internet_se.rb +1 -1
- data/test/test_job.rb +1 -1
- data/test/test_job_fr.rb +1 -1
- data/test/test_job_ja.rb +1 -1
- data/test/test_job_kr.rb +1 -1
- data/test/test_lorem.rb +13 -13
- data/test/test_lorem_ar.rb +8 -8
- data/test/test_lorem_cn.rb +10 -10
- data/test/test_lorem_fr.rb +8 -8
- data/test/test_lorem_kr.rb +2 -2
- data/test/test_module_utils.rb +1 -1
- data/test/test_movie.rb +1 -1
- data/test/test_name.rb +1 -1
- data/test/test_name_br.rb +1 -1
- data/test/test_name_cn.rb +1 -1
- data/test/test_name_cs.rb +6 -6
- data/test/test_name_de.rb +1 -1
- data/test/test_name_fr.rb +10 -10
- data/test/test_name_ga.rb +12 -12
- data/test/test_name_it.rb +10 -10
- data/test/test_name_ja.rb +2 -2
- data/test/test_name_kr.rb +1 -1
- data/test/test_name_mx.rb +58 -58
- data/test/test_name_nb.rb +5 -5
- data/test/test_name_nl.rb +1 -1
- data/test/test_name_ph.rb +1 -1
- data/test/test_name_ru.rb +5 -5
- data/test/test_name_se.rb +5 -5
- data/test/test_name_sn.rb +21 -21
- data/test/test_name_th.rb +6 -6
- data/test/test_nato_alphabet.rb +5 -5
- data/test/test_phone_number.rb +2 -2
- data/test/test_phone_number_au.rb +10 -10
- data/test/test_phone_number_cu.rb +13 -13
- data/test/test_phone_number_de.rb +10 -10
- data/test/test_phone_number_kr.rb +1 -1
- data/test/test_phone_number_mx.rb +1 -1
- data/test/test_phone_number_nl.rb +1 -1
- data/test/test_phone_number_se.rb +15 -15
- data/test/test_phone_number_sg.rb +1 -1
- data/test/test_phone_number_sn.rb +7 -7
- data/test/test_skill.rb +4 -4
- data/test/test_ssn.rb +1 -1
- data/test/test_ssn_mx.rb +10 -10
- data/test/test_ssn_se.rb +5 -5
- data/test/test_string.rb +1 -1
- data/test/test_time.rb +1 -1
- data/test/test_units.rb +5 -5
- data/test/test_units_english.rb +11 -11
- data/test/test_units_metric.rb +11 -11
- data/test/test_vehicle.rb +9 -9
- data/test/test_venue.rb +1 -1
- metadata +3 -3
data/test/test_name_nb.rb
CHANGED
@@ -5,23 +5,23 @@ require 'helper'
|
|
5
5
|
class TestFakerNameNB < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::NameNB
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_last_name
|
12
|
-
assert
|
12
|
+
assert FFaker::NameNB::LAST_NAMES.include?(@tester.last_name)
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_first_name_male
|
16
|
-
assert
|
16
|
+
assert FFaker::NameNB::FIRST_NAMES_MALE.include?(@tester.first_name_male)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_first_name_female
|
20
|
-
assert
|
20
|
+
assert FFaker::NameNB::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_prefix
|
24
|
-
assert
|
24
|
+
assert FFaker::NameNB::PREFIXES.include?(@tester.prefix)
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_first_name
|
data/test/test_name_nl.rb
CHANGED
data/test/test_name_ph.rb
CHANGED
data/test/test_name_ru.rb
CHANGED
@@ -4,7 +4,7 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestFakerNameRu < Test::Unit::TestCase
|
6
6
|
def setup
|
7
|
-
@tester =
|
7
|
+
@tester = FFaker::NameRU
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_name
|
@@ -23,7 +23,7 @@ class TestFakerNameRu < Test::Unit::TestCase
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_male_last_name
|
26
|
-
assert
|
26
|
+
assert FFaker::NameRU::LAST_NAMES[:male].include?(@tester.last_name(:male))
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_first_name
|
@@ -31,7 +31,7 @@ class TestFakerNameRu < Test::Unit::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_male_first_name
|
34
|
-
assert
|
34
|
+
assert FFaker::NameRU::FIRST_NAMES[:male].include?(@tester.first_name(:male))
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_patronymic
|
@@ -39,7 +39,7 @@ class TestFakerNameRu < Test::Unit::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_male_patronymic
|
42
|
-
assert
|
42
|
+
assert FFaker::NameRU::PATRONYMICS[:male].include?(@tester.patronymic(:male))
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_with_same_sex
|
@@ -66,7 +66,7 @@ class TestFakerNameRu < Test::Unit::TestCase
|
|
66
66
|
def same_sex?(words, sex = :any)
|
67
67
|
(sex == :any ? [:male, :female] : [sex]).any? do |sex|
|
68
68
|
words.all? do |word|
|
69
|
-
[
|
69
|
+
[FFaker::NameRU::LAST_NAMES, FFaker::NameRU::FIRST_NAMES, FFaker::NameRU::PATRONYMICS].any? do |names|
|
70
70
|
names[sex].include?(word)
|
71
71
|
end
|
72
72
|
end
|
data/test/test_name_se.rb
CHANGED
@@ -5,23 +5,23 @@ require 'helper'
|
|
5
5
|
class TestFakerNameSE < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::NameSE
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_last_name
|
12
|
-
assert
|
12
|
+
assert FFaker::NameSE::LAST_NAMES.include?(@tester.last_name)
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_first_name_male
|
16
|
-
assert
|
16
|
+
assert FFaker::NameSE::FIRST_NAMES_MALE.include?(@tester.first_name_male)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_first_name_female
|
20
|
-
assert
|
20
|
+
assert FFaker::NameSE::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_prefix
|
24
|
-
assert
|
24
|
+
assert FFaker::NameSE::PREFIXES.include?(@tester.prefix)
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_first_name
|
data/test/test_name_sn.rb
CHANGED
@@ -6,27 +6,27 @@ require 'helper'
|
|
6
6
|
class TestFakerNameSn < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
|
-
@tester =
|
9
|
+
@tester = FFaker::NameSN
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_last_name
|
13
|
-
assert
|
13
|
+
assert FFaker::NameSN::LAST_NAMES.include?(@tester.last_name)
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_first_name_male
|
17
|
-
assert
|
17
|
+
assert FFaker::NameSN::FIRST_NAMES_MALE.include?(@tester.first_name_male)
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_first_name_female
|
21
|
-
assert
|
21
|
+
assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_prefix_male
|
25
|
-
assert
|
25
|
+
assert FFaker::NameSN::PREFIX_MALE.include?(@tester.prefix_male)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_prefix_female
|
29
|
-
assert
|
29
|
+
assert FFaker::NameSN::PREFIX_FEMALE.include?(@tester.prefix_female)
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_name_male
|
@@ -35,20 +35,20 @@ class TestFakerNameSn < Test::Unit::TestCase
|
|
35
35
|
|
36
36
|
if parts.count == 3
|
37
37
|
# the value at the index 0 should be a valid! male_prefix
|
38
|
-
assert
|
38
|
+
assert FFaker::NameSN::PREFIX_MALE.include?(parts[0])
|
39
39
|
|
40
40
|
# the value at the index 1 should be a valid! male_first_name
|
41
|
-
assert
|
41
|
+
assert FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[1])
|
42
42
|
|
43
43
|
# the value at the index 2 should be a valid! last_name
|
44
|
-
assert
|
44
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
|
45
45
|
|
46
46
|
elsif parts.count == 2
|
47
47
|
# the value at the index 0 should be a valid! male_prefix
|
48
|
-
assert
|
48
|
+
assert FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[0])
|
49
49
|
|
50
50
|
# the value at the index 1 should be a valid! last_name
|
51
|
-
assert
|
51
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -58,19 +58,19 @@ class TestFakerNameSn < Test::Unit::TestCase
|
|
58
58
|
|
59
59
|
if parts.count == 3
|
60
60
|
# the value at the index 0 should be a valid! male_prefix
|
61
|
-
assert
|
61
|
+
assert FFaker::NameSN::PREFIX_FEMALE.include?(parts[0])
|
62
62
|
|
63
63
|
# the value at the index 1 should be a valid! male_first_name
|
64
|
-
assert
|
64
|
+
assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[1])
|
65
65
|
|
66
66
|
# the value at the index 2 should be a valid! last_name
|
67
|
-
assert
|
67
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
|
68
68
|
elsif parts.count == 2
|
69
69
|
# the value at the index 0 should be a valid! male_prefix
|
70
|
-
assert
|
70
|
+
assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[0])
|
71
71
|
|
72
72
|
# the value at the index 1 should be a valid! last_name
|
73
|
-
assert
|
73
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -80,19 +80,19 @@ class TestFakerNameSn < Test::Unit::TestCase
|
|
80
80
|
|
81
81
|
if parts.count == 3
|
82
82
|
# the value at the index 0 should be a valid! male or female prefix
|
83
|
-
assert
|
83
|
+
assert FFaker::NameSN::PREFIX_FEMALE.include?(parts[0]) || FFaker::NameSN::PREFIX_MALE.include?(parts[0])
|
84
84
|
|
85
85
|
# the value at the index 1 should be a valid! firstname male or female
|
86
|
-
assert
|
86
|
+
assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[1]) || FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[1])
|
87
87
|
|
88
88
|
# the value at the index 2 should be a valid! firstname male or female
|
89
|
-
assert
|
89
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
|
90
90
|
elsif parts.count == 2
|
91
91
|
# the value at the index 0 should be a valid! firstname male or female
|
92
|
-
assert
|
92
|
+
assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[0]) || FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[0])
|
93
93
|
|
94
94
|
# the value at the index 0 should be a valid! firstname male or female
|
95
|
-
assert
|
95
|
+
assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
data/test/test_name_th.rb
CHANGED
@@ -5,25 +5,25 @@ require 'helper'
|
|
5
5
|
class TestFakerNameTH < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::NameTH
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_last_name
|
12
|
-
assert
|
12
|
+
assert FFaker::NameTH::LAST_NAMES.include?(@tester.last_name)
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_first_name
|
16
|
-
assert
|
16
|
+
assert FFaker::NameTH::FIRST_NAMES.include?(@tester.first_name)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_nick_name
|
20
|
-
assert
|
20
|
+
assert FFaker::NameTH::NICK_NAMES.include?(@tester.nick_name)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_name
|
24
24
|
parts = @tester.name.split(' ')
|
25
|
-
assert
|
26
|
-
assert
|
25
|
+
assert FFaker::NameTH::FIRST_NAMES.include?(parts[0])
|
26
|
+
assert FFaker::NameTH::LAST_NAMES.include?(parts[1])
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
data/test/test_nato_alphabet.rb
CHANGED
@@ -4,19 +4,19 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestNato < Test::Unit::TestCase
|
6
6
|
def setup
|
7
|
-
@tester =
|
7
|
+
@tester = FFaker::NatoAlphabet
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_code
|
11
|
-
assert
|
11
|
+
assert FFaker::NatoAlphabet::CODES.include?(@tester.code)
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_letter_code
|
15
|
-
assert
|
15
|
+
assert FFaker::NatoAlphabet::ALPHABET_CODES.include?(@tester.alphabetic_code)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_numerify_code
|
19
|
-
assert
|
19
|
+
assert FFaker::NatoAlphabet::NUMERIC_CODES.include?(@tester.numeric_code)
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_callsign
|
@@ -26,6 +26,6 @@ class TestNato < Test::Unit::TestCase
|
|
26
26
|
def test_codify
|
27
27
|
assert_match /[A-Z]+-[A-Z]+-[A-Z]+/, @tester.codify("?-?-?")
|
28
28
|
assert_match /[A-Z]+-[A-Z]+-[A-Z]+/, @tester.codify("?-#-?")
|
29
|
-
assert_match
|
29
|
+
assert_match FFaker::NatoAlphabet::STOP_CODE, @tester.codify(".")
|
30
30
|
end
|
31
31
|
end
|
data/test/test_phone_number.rb
CHANGED
@@ -4,10 +4,10 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestPhoneNumer < Test::Unit::TestCase
|
6
6
|
def test_phone_number
|
7
|
-
assert_match /\d{3}[. -]\d{3}/,
|
7
|
+
assert_match /\d{3}[. -]\d{3}/, FFaker::PhoneNumber.phone_number
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_short_phone_number
|
11
|
-
assert_match /\d{3}-\d{3}-\d{4}/,
|
11
|
+
assert_match /\d{3}-\d{3}-\d{4}/, FFaker::PhoneNumber.short_phone_number
|
12
12
|
end
|
13
13
|
end
|
@@ -5,46 +5,46 @@ require 'helper'
|
|
5
5
|
# Author: wiseleyb<wiseleyb@gmail.com>
|
6
6
|
class TestPhoneNumberAU < Test::Unit::TestCase
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::PhoneNumberAU
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_mobile_phone_prefix
|
12
|
-
assert
|
12
|
+
assert FFaker::PhoneNumberAU::MobileOperatorsPrefix.include?(@tester.mobile_phone_prefix)
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_home_work_phone_prefix
|
16
|
-
assert
|
16
|
+
assert FFaker::PhoneNumberAU::HomeWorkOperatorsPrefix.include?(@tester.home_work_phone_prefix)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_phone_prefix
|
20
|
-
assert
|
20
|
+
assert FFaker::PhoneNumberAU::OperatorsPrefix.include?(@tester.phone_prefix)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_mobile_phone_number
|
24
|
-
assert_match /04\d{2} \d{3} \d{3}/,
|
24
|
+
assert_match /04\d{2} \d{3} \d{3}/, FFaker::PhoneNumberAU.mobile_phone_number
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_home_work_phone_number
|
28
|
-
assert_match /\(\d{2}\) \d{4} \d{4}/,
|
28
|
+
assert_match /\(\d{2}\) \d{4} \d{4}/, FFaker::PhoneNumberAU.home_work_phone_number
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_phone_number
|
32
32
|
10.times do
|
33
|
-
assert_match /(04\d{1,2} \d{3} \d{3}|\(\d{2}\) \d{4} \d{4})/,
|
33
|
+
assert_match /(04\d{1,2} \d{3} \d{3}|\(\d{2}\) \d{4} \d{4})/, FFaker::PhoneNumberAU.phone_number
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_international_mobile_phone_number
|
38
|
-
assert_match /\+61 \d{1,2} \d{4} \d{4}/,
|
38
|
+
assert_match /\+61 \d{1,2} \d{4} \d{4}/, FFaker::PhoneNumberAU.international_mobile_phone_number
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_international_home_work_phone_number
|
42
|
-
assert_match /\+61 \d{1,2} \d{4} \d{4}/,
|
42
|
+
assert_match /\+61 \d{1,2} \d{4} \d{4}/, FFaker::PhoneNumberAU.international_home_work_phone_number
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_international_phone_number
|
46
46
|
10.times do
|
47
|
-
assert_match /\+61 \d{1,2} \d{4} \d{4}/,
|
47
|
+
assert_match /\+61 \d{1,2} \d{4} \d{4}/, FFaker::PhoneNumberAU.international_phone_number
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -5,24 +5,24 @@ require 'helper'
|
|
5
5
|
# Author: Luilver<luilver@gmail.com>
|
6
6
|
class TestPhoneNumberCU < Test::Unit::TestCase
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::PhoneNumberCU
|
9
9
|
end
|
10
10
|
|
11
11
|
# Prefix format test
|
12
12
|
#
|
13
13
|
def test_mobile_phone_prefix
|
14
|
-
assert
|
14
|
+
assert FFaker::PhoneNumberCU::MobileOperatorsPrefix.include?(
|
15
15
|
@tester.mobile_phone_prefix)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_home_work_phone_prefix
|
19
|
-
assert
|
19
|
+
assert FFaker::PhoneNumberCU::HomeWorkOperatorsPrefix.include?(
|
20
20
|
@tester.home_work_phone_prefix)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_phone_prefix
|
24
24
|
10.times do
|
25
|
-
assert
|
25
|
+
assert FFaker::PhoneNumberCU::OperatorsPrefix.include?(
|
26
26
|
@tester.phone_prefix)
|
27
27
|
end
|
28
28
|
end
|
@@ -31,18 +31,18 @@ class TestPhoneNumberCU < Test::Unit::TestCase
|
|
31
31
|
#
|
32
32
|
def test_mobile_phone_number
|
33
33
|
assert_match /05 \d{3} \d{4}/,
|
34
|
-
|
34
|
+
FFaker::PhoneNumberCU.mobile_phone_number
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_home_work_phone_number
|
38
38
|
assert_match /\(0(7\) \d{3}|\d{2}\) \d{2}) \d{4}/,
|
39
|
-
|
39
|
+
FFaker::PhoneNumberCU.home_work_phone_number
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_general_phone_number
|
43
43
|
10.times do
|
44
44
|
assert_match /((05|\(07\)) \d{3}|\(0\d{2}\) \d{2}) \d{4}/,
|
45
|
-
|
45
|
+
FFaker::PhoneNumberCU.general_phone_number
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -50,18 +50,18 @@ class TestPhoneNumberCU < Test::Unit::TestCase
|
|
50
50
|
#
|
51
51
|
def test_international_mobile_phone_number
|
52
52
|
assert_match /(00|\+)535 \d{3} \d{4}/,
|
53
|
-
|
53
|
+
FFaker::PhoneNumberCU.international_mobile_phone_number
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_international_home_work_phone_number
|
57
57
|
assert_match /(00|\+)53(7 \d{3}|\d{2} \d{2}) \d{4}/,
|
58
|
-
|
58
|
+
FFaker::PhoneNumberCU.international_home_work_phone_number
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_international_phone_number
|
62
62
|
10.times do
|
63
63
|
assert_match /(00|\+)53((5|7) \d{3}|\d{2} \d{2}) \d{4}/,
|
64
|
-
|
64
|
+
FFaker::PhoneNumberCU.international_phone_number
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -69,18 +69,18 @@ class TestPhoneNumberCU < Test::Unit::TestCase
|
|
69
69
|
#
|
70
70
|
def test_e164_mobile_phone_number
|
71
71
|
assert_match /535\d{7}/,
|
72
|
-
|
72
|
+
FFaker::PhoneNumberCU.e164_mobile_phone_number
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_e164_home_work_phone_number
|
76
76
|
assert_match /53(7\d{7}|\d{2}\d{6})/,
|
77
|
-
|
77
|
+
FFaker::PhoneNumberCU.e164_home_work_phone_number
|
78
78
|
end
|
79
79
|
|
80
80
|
def test_e164_phone_number
|
81
81
|
10.times do
|
82
82
|
assert_match /53((5|7)\d{7}|\d{2}\d{6})/,
|
83
|
-
|
83
|
+
FFaker::PhoneNumberCU.e164_phone_number
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|