ffaker 2.0.0 → 2.1.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 +32 -0
- data/README.md +7 -6
- data/REFERENCE.md +1355 -0
- data/Rakefile +6 -6
- data/ffaker.gemspec +16 -3
- data/lib/ffaker.rb +1 -1
- data/lib/ffaker/address_ca.rb +3 -3
- data/lib/ffaker/avatar.rb +20 -0
- data/lib/ffaker/bacon_ipsum.rb +1 -1
- data/lib/ffaker/data/job_cn/job_nouns +300 -0
- data/lib/ffaker/data/sport/names +34 -0
- data/lib/ffaker/dizzle_ipsum.rb +1 -1
- data/lib/ffaker/healthcare_ipsum.rb +1 -1
- data/lib/ffaker/hipster_ipsum.rb +1 -1
- data/lib/ffaker/html_ipsum.rb +1 -1
- data/lib/ffaker/identification_kr.rb +20 -0
- data/lib/ffaker/identification_mx.rb +3 -3
- data/lib/ffaker/internet.rb +3 -3
- data/lib/ffaker/internet_se.rb +1 -1
- data/lib/ffaker/job_cn.rb +12 -0
- data/lib/ffaker/job_fr.rb +6 -2
- data/lib/ffaker/locale.rb +1 -1
- data/lib/ffaker/lorem.rb +7 -5
- 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 +6 -0
- data/lib/ffaker/phone_number.rb +46 -17
- data/lib/ffaker/product.rb +1 -1
- data/lib/ffaker/skill.rb +1 -1
- data/lib/ffaker/sport.rb +10 -0
- data/lib/ffaker/string.rb +22 -11
- data/lib/ffaker/utils/array_utils.rb +4 -3
- data/lib/ffaker/vehicle.rb +1 -1
- data/scripts/reference.rb +89 -0
- data/test/test_address_ca.rb +6 -4
- data/test/test_array_utils.rb +3 -3
- data/test/test_avatar.rb +50 -0
- data/test/test_company.rb +8 -6
- data/test/test_identification.rb +5 -4
- data/test/test_identification_kr.rb +13 -0
- data/test/test_internet.rb +4 -0
- data/test/test_job.rb +1 -2
- data/test/test_job_cn.rb +17 -0
- data/test/test_job_fr.rb +4 -7
- data/test/test_job_ja.rb +1 -1
- data/test/test_job_kr.rb +1 -1
- data/test/test_locale.rb +21 -0
- data/test/test_lorem_kr.rb +1 -1
- data/test/test_movie.rb +8 -0
- data/test/test_name.rb +3 -3
- data/test/test_name_br.rb +7 -8
- data/test/test_name_cs.rb +8 -6
- data/test/test_name_de.rb +3 -3
- data/test/test_name_fr.rb +15 -17
- data/test/test_name_ga.rb +12 -14
- data/test/test_name_it.rb +14 -15
- data/test/test_name_ja.rb +1 -1
- data/test/test_name_mx.rb +82 -80
- data/test/test_name_nb.rb +6 -9
- data/test/test_name_nl.rb +3 -3
- data/test/test_name_ph.rb +12 -2
- data/test/test_name_ru.rb +14 -10
- data/test/test_name_se.rb +6 -9
- data/test/test_name_sn.rb +39 -52
- data/test/test_name_th.rb +7 -9
- data/test/test_phone_number.rb +9 -0
- data/test/test_sports.rb +13 -0
- data/test/test_string.rb +26 -16
- data/test/test_units.rb +8 -10
- data/test/test_units_english.rb +15 -22
- data/test/test_units_metric.rb +15 -21
- metadata +22 -4
data/test/test_name_cs.rb
CHANGED
@@ -9,7 +9,7 @@ class TestFakerNameCS < Test::Unit::TestCase
|
|
9
9
|
|
10
10
|
def test_name
|
11
11
|
@words = @tester.name.split
|
12
|
-
|
12
|
+
assert_include([2, 3, 4], @words.size) # just name, or prefix, or prefix+suffix
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_name_sex
|
@@ -19,19 +19,19 @@ class TestFakerNameCS < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_male_last_name
|
22
|
-
|
22
|
+
assert_include(@tester::LAST_NAMES[:male], @tester.last_name(:male))
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_male_first_name
|
26
|
-
|
26
|
+
assert_include(@tester::FIRST_NAMES[:male], @tester.first_name(:male))
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_prefix
|
30
|
-
|
30
|
+
assert_include(@tester::PREFIXES, @tester.prefix)
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_suffix
|
34
|
-
|
34
|
+
assert_include(@tester::SUFFIXES, @tester.suffix)
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_with_same_sex
|
@@ -52,11 +52,13 @@ class TestFakerNameCS < Test::Unit::TestCase
|
|
52
52
|
assert same_sex?(names, :male)
|
53
53
|
end
|
54
54
|
|
55
|
+
private
|
56
|
+
|
55
57
|
# checks if every name is of the same sex
|
56
58
|
def same_sex?(words, sex = :any)
|
57
59
|
(sex == :any ? [:male, :female] : [sex]).any? do |sex|
|
58
60
|
words.all? do |word|
|
59
|
-
[
|
61
|
+
[@tester::LAST_NAMES, @tester::FIRST_NAMES].any? do |names|
|
60
62
|
names[sex].include?(word)
|
61
63
|
end
|
62
64
|
end
|
data/test/test_name_de.rb
CHANGED
@@ -8,14 +8,14 @@ class TestFakerNameDE < Test::Unit::TestCase
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_name
|
11
|
-
|
11
|
+
assert_match(/\A([\w']+\.? ?){2,3}\z/, @tester.name)
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_prefix
|
15
|
-
|
15
|
+
assert_match(/\A[A-Z][a-z]+\.?\z/, @tester.prefix)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_suffix
|
19
|
-
|
19
|
+
assert_include(@tester::SUFFIXES, @tester.suffix)
|
20
20
|
end
|
21
21
|
end
|
data/test/test_name_fr.rb
CHANGED
@@ -4,45 +4,43 @@ require 'helper'
|
|
4
4
|
|
5
5
|
# Author: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
|
6
6
|
class TestFakerNameFR < Test::Unit::TestCase
|
7
|
-
|
8
7
|
def setup
|
9
8
|
@tester = FFaker::NameFR
|
10
9
|
end
|
11
10
|
|
12
11
|
def test_last_name
|
13
|
-
|
12
|
+
assert_include @tester::LAST_NAMES, @tester.last_name
|
14
13
|
end
|
15
14
|
|
16
15
|
def test_first_name
|
17
|
-
|
16
|
+
assert_include @tester::FIRST_NAMES, @tester.first_name
|
18
17
|
end
|
19
18
|
|
20
19
|
def test_prefix
|
21
|
-
|
20
|
+
assert_include @tester::PREFIX, @tester.prefix
|
22
21
|
end
|
23
22
|
|
24
|
-
|
25
23
|
def test_name
|
26
24
|
# => split the name into an array of words
|
27
25
|
parts = @tester.name.split(' ')
|
28
|
-
|
29
|
-
|
26
|
+
case parts.count
|
27
|
+
when 3
|
28
|
+
first_name, prefix, last_name = parts
|
30
29
|
# the value at the index 1 should be a valid! prefix
|
31
|
-
|
30
|
+
assert_include @tester::PREFIX, prefix
|
32
31
|
|
33
|
-
# the value at the index 0 should be a valid!
|
34
|
-
|
32
|
+
# the value at the index 0 should be a valid! first_name
|
33
|
+
assert_include @tester::FIRST_NAMES, first_name
|
35
34
|
|
36
35
|
# the value at the index 2 should be a valid! last_name
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# the value at the index 0 should be a valid!
|
41
|
-
|
36
|
+
assert_include @tester::LAST_NAMES, last_name
|
37
|
+
when 2
|
38
|
+
first_name, last_name = parts
|
39
|
+
# the value at the index 0 should be a valid! first_name
|
40
|
+
assert_include @tester::FIRST_NAMES, first_name
|
42
41
|
|
43
42
|
# the value at the index 1 should be a valid! last_name
|
44
|
-
|
43
|
+
assert_include @tester::LAST_NAMES, last_name
|
45
44
|
end
|
46
45
|
end
|
47
|
-
|
48
46
|
end
|
data/test/test_name_ga.rb
CHANGED
@@ -3,54 +3,52 @@
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
5
|
class TestFakerNameGa < Test::Unit::TestCase
|
6
|
-
|
7
6
|
def setup
|
8
7
|
@tester = FFaker::NameGA
|
9
8
|
end
|
10
9
|
|
11
10
|
def test_last_name
|
12
|
-
|
11
|
+
assert_include @tester::LAST_NAMES, @tester.last_name
|
13
12
|
end
|
14
13
|
|
15
14
|
def test_first_name_male
|
16
|
-
|
15
|
+
assert_include @tester::FIRST_NAMES_MALE, @tester.first_name_male
|
17
16
|
end
|
18
17
|
|
19
18
|
def test_first_name_female
|
20
|
-
|
19
|
+
assert_include @tester::FIRST_NAMES_FEMALE, @tester.first_name_female
|
21
20
|
end
|
22
21
|
|
23
22
|
def test_name_male
|
24
23
|
# => split the name_male into an array of words
|
25
|
-
|
24
|
+
first_name, last_name = @tester.name_male.split(' ')
|
26
25
|
|
27
26
|
# the value at the index 0 should be a valid! male_prefix
|
28
|
-
|
27
|
+
assert_include @tester::FIRST_NAMES_MALE, first_name
|
29
28
|
|
30
29
|
# the value at the index 1 should be a valid! last_name
|
31
|
-
|
30
|
+
assert_include @tester::LAST_NAMES, last_name
|
32
31
|
end
|
33
32
|
|
34
33
|
def test_name_female
|
35
34
|
# => split the name_male into an array of words
|
36
|
-
|
35
|
+
first_name, last_name = @tester.name_female.split(' ')
|
37
36
|
|
38
37
|
# the value at the index 0 should be a valid! male_prefix
|
39
|
-
|
38
|
+
assert_include @tester::FIRST_NAMES_FEMALE, first_name
|
40
39
|
|
41
40
|
# the value at the index 1 should be a valid! last_name
|
42
|
-
|
41
|
+
assert_include @tester::LAST_NAMES, last_name
|
43
42
|
end
|
44
43
|
|
45
|
-
|
46
44
|
def test_name
|
47
45
|
# => split the name_male into an array of words
|
48
|
-
|
46
|
+
first_name, last_name = @tester.name.split(' ')
|
49
47
|
|
50
48
|
# the value at the index 0 should be a valid! male_prefix
|
51
|
-
|
49
|
+
assert_include(@tester::FIRST_NAMES_FEMALE + @tester::FIRST_NAMES_MALE, first_name)
|
52
50
|
|
53
51
|
# the value at the index 1 should be a valid! last_name
|
54
|
-
|
52
|
+
assert_include @tester::LAST_NAMES, last_name
|
55
53
|
end
|
56
54
|
end
|
data/test/test_name_it.rb
CHANGED
@@ -4,45 +4,44 @@ require 'helper'
|
|
4
4
|
|
5
5
|
# Author: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
|
6
6
|
class TestFakerNameIT < Test::Unit::TestCase
|
7
|
-
|
8
7
|
def setup
|
9
8
|
@tester = FFaker::NameIT
|
10
9
|
end
|
11
10
|
|
12
11
|
def test_last_name
|
13
|
-
|
12
|
+
assert_include @tester::LAST_NAMES, @tester.last_name
|
14
13
|
end
|
15
14
|
|
16
15
|
def test_first_name
|
17
|
-
|
16
|
+
assert_include @tester::FIRST_NAMES, @tester.first_name
|
18
17
|
end
|
19
18
|
|
20
19
|
def test_prefix
|
21
|
-
|
20
|
+
assert_include @tester::PREFIX, @tester.prefix
|
22
21
|
end
|
23
22
|
|
24
|
-
|
25
23
|
def test_name
|
26
24
|
# => split the name into an array of words
|
27
25
|
parts = @tester.name.split(' ')
|
28
26
|
|
29
|
-
|
27
|
+
case parts.count
|
28
|
+
when 3
|
29
|
+
prefix, first_name, last_name = parts
|
30
30
|
# the value at the index 0 should be a valid! prefix
|
31
|
-
|
31
|
+
assert_include @tester::PREFIX, prefix
|
32
32
|
|
33
33
|
# the value at the index 1 should be a valid! first_name
|
34
|
-
|
34
|
+
assert_include @tester::FIRST_NAMES, first_name
|
35
35
|
|
36
36
|
# the value at the index 2 should be a valid! last_name
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# the value at the index 0 should be a valid!
|
41
|
-
|
37
|
+
assert_include @tester::LAST_NAMES, last_name
|
38
|
+
when 2
|
39
|
+
first_name, last_name = parts
|
40
|
+
# the value at the index 0 should be a valid! first_name
|
41
|
+
assert_include @tester::FIRST_NAMES, first_name
|
42
42
|
|
43
43
|
# the value at the index 1 should be a valid! last_name
|
44
|
-
|
44
|
+
assert_include @tester::LAST_NAMES, last_name
|
45
45
|
end
|
46
46
|
end
|
47
|
-
|
48
47
|
end
|
data/test/test_name_ja.rb
CHANGED
data/test/test_name_mx.rb
CHANGED
@@ -4,55 +4,58 @@ require 'helper'
|
|
4
4
|
|
5
5
|
# Author: guapolo github.com/guapolo
|
6
6
|
class TestFakerNameMX < Test::Unit::TestCase
|
7
|
-
|
8
7
|
def setup
|
9
8
|
@tester = FFaker::NameMX
|
10
|
-
@all_names =
|
9
|
+
@all_names = @tester::MALE_FIRST_NAMES + @tester::FEMALE_FIRST_NAMES
|
11
10
|
end
|
12
11
|
|
13
12
|
def test_last_name
|
14
|
-
|
13
|
+
assert_include @tester::LAST_NAMES, @tester.last_name
|
15
14
|
end
|
16
15
|
|
17
16
|
def test_first_name
|
18
|
-
|
17
|
+
assert_include @all_names, @tester.first_name
|
19
18
|
end
|
20
19
|
|
21
20
|
def test_middle_name
|
22
|
-
|
21
|
+
assert_include @all_names, @tester.middle_name
|
23
22
|
end
|
24
23
|
|
25
24
|
def test_name
|
26
|
-
|
25
|
+
assert_include @all_names, @tester.name
|
27
26
|
end
|
28
27
|
|
29
28
|
def test_prefix_male
|
30
|
-
|
29
|
+
assert_include @tester::MALE_PREFIXES, @tester.male_prefix
|
31
30
|
end
|
32
31
|
|
33
32
|
def test_prefix_female
|
34
|
-
|
33
|
+
assert_include @tester::FEMALE_PREFIXES, @tester.female_prefix
|
35
34
|
end
|
36
35
|
|
37
36
|
def test_prefix
|
38
|
-
|
37
|
+
assert_include @tester::PREFIXES, @tester.prefix
|
39
38
|
end
|
40
39
|
|
41
40
|
def test_male_name
|
42
41
|
parts = @tester.male_name.split(' ')
|
43
42
|
case parts.count
|
44
|
-
when 1
|
45
|
-
|
46
|
-
|
43
|
+
when 1
|
44
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[0]
|
45
|
+
when 2
|
46
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[0]
|
47
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[1]
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
50
51
|
def test_female_name
|
51
52
|
parts = @tester.female_name.split(' ')
|
52
53
|
case parts.count
|
53
|
-
when 1
|
54
|
-
|
55
|
-
|
54
|
+
when 1
|
55
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[0]
|
56
|
+
when 2
|
57
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[0]
|
58
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[1]
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
@@ -60,25 +63,25 @@ class TestFakerNameMX < Test::Unit::TestCase
|
|
60
63
|
parts = @tester.full_name(:male).split(' ')
|
61
64
|
case parts.count
|
62
65
|
when 5
|
63
|
-
|
64
|
-
|
66
|
+
assert_include @tester::MALE_PREFIXES, parts[0]
|
67
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[1]
|
65
68
|
# Middle name
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[2]
|
70
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
71
|
+
assert_include @tester::LAST_NAMES, parts[4]
|
69
72
|
when 4
|
70
|
-
prefix_or_first_name =
|
71
|
-
|
73
|
+
prefix_or_first_name = @tester::MALE_PREFIXES.include?(parts[0]) ||
|
74
|
+
@tester::MALE_FIRST_NAMES.include?(parts[0])
|
72
75
|
assert prefix_or_first_name
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[1]
|
77
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
78
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
76
79
|
when 3
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
+
assert_include @tester::MALE_FIRST_NAMES, parts[0]
|
81
|
+
assert_include @tester::LAST_NAMES, parts[1]
|
82
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
80
83
|
else
|
81
|
-
flunk
|
84
|
+
flunk 'Invalid Male Name'
|
82
85
|
end
|
83
86
|
end
|
84
87
|
|
@@ -86,25 +89,25 @@ class TestFakerNameMX < Test::Unit::TestCase
|
|
86
89
|
parts = @tester.full_name(:female).split(' ')
|
87
90
|
case parts.count
|
88
91
|
when 5
|
89
|
-
|
90
|
-
|
92
|
+
assert_include @tester::FEMALE_PREFIXES, parts[0]
|
93
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[1]
|
91
94
|
# Middle name
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[2]
|
96
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
97
|
+
assert_include @tester::LAST_NAMES, parts[4]
|
95
98
|
when 4
|
96
|
-
prefix_or_first_name =
|
97
|
-
|
99
|
+
prefix_or_first_name = @tester::FEMALE_PREFIXES.include?(parts[0]) ||
|
100
|
+
@tester::FEMALE_FIRST_NAMES.include?(parts[0])
|
98
101
|
assert prefix_or_first_name
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[1]
|
103
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
104
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
102
105
|
when 3
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
+
assert_include @tester::FEMALE_FIRST_NAMES, parts[0]
|
107
|
+
assert_include @tester::LAST_NAMES, parts[1]
|
108
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
106
109
|
else
|
107
|
-
flunk
|
110
|
+
flunk 'Invalid Female Name'
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
@@ -112,25 +115,25 @@ class TestFakerNameMX < Test::Unit::TestCase
|
|
112
115
|
parts = @tester.full_name.split(' ')
|
113
116
|
case parts.count
|
114
117
|
when 5
|
115
|
-
|
116
|
-
|
118
|
+
assert_include @tester::PREFIXES, parts[0]
|
119
|
+
assert_include @all_names, parts[1]
|
117
120
|
# Middle name
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
+
assert_include @all_names, parts[2]
|
122
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
123
|
+
assert_include @tester::LAST_NAMES, parts[4]
|
121
124
|
when 4
|
122
|
-
prefix_or_first_name =
|
123
|
-
|
125
|
+
prefix_or_first_name = @tester::PREFIXES.include?(parts[0]) ||
|
126
|
+
@all_names.include?(parts[0])
|
124
127
|
assert prefix_or_first_name
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
+
assert_include @all_names, parts[1]
|
129
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
130
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
128
131
|
when 3
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
+
assert_include @all_names, parts[0]
|
133
|
+
assert_include @tester::LAST_NAMES, parts[1]
|
134
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
132
135
|
else
|
133
|
-
flunk
|
136
|
+
flunk 'Invalid Name'
|
134
137
|
end
|
135
138
|
end
|
136
139
|
|
@@ -138,16 +141,16 @@ class TestFakerNameMX < Test::Unit::TestCase
|
|
138
141
|
parts = @tester.full_name_no_prefix.split(' ')
|
139
142
|
case parts.count
|
140
143
|
when 4
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
144
|
+
assert_include @all_names, parts[0]
|
145
|
+
assert_include @all_names, parts[1]
|
146
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
147
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
145
148
|
when 3
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
+
assert_include @all_names, parts[0]
|
150
|
+
assert_include @tester::LAST_NAMES, parts[1]
|
151
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
149
152
|
else
|
150
|
-
flunk
|
153
|
+
flunk 'Invalid Name'
|
151
154
|
end
|
152
155
|
end
|
153
156
|
|
@@ -155,26 +158,25 @@ class TestFakerNameMX < Test::Unit::TestCase
|
|
155
158
|
parts = @tester.full_name_prefix.split(' ')
|
156
159
|
case parts.count
|
157
160
|
when 5
|
158
|
-
|
159
|
-
|
161
|
+
assert_include @tester::PREFIXES, parts[0]
|
162
|
+
assert_include @all_names, parts[1]
|
160
163
|
# Middle name
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
+
assert_include @all_names, parts[2]
|
165
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
166
|
+
assert_include @tester::LAST_NAMES, parts[4]
|
164
167
|
when 4
|
165
|
-
prefix_or_first_name =
|
166
|
-
|
168
|
+
prefix_or_first_name = @tester::PREFIXES.include?(parts[0]) ||
|
169
|
+
@all_names.include?(parts[0])
|
167
170
|
assert prefix_or_first_name
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
+
assert_include @all_names, parts[1]
|
172
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
173
|
+
assert_include @tester::LAST_NAMES, parts[3]
|
171
174
|
when 3
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
+
assert_include @all_names, parts[0]
|
176
|
+
assert_include @tester::LAST_NAMES, parts[1]
|
177
|
+
assert_include @tester::LAST_NAMES, parts[2]
|
175
178
|
else
|
176
|
-
flunk
|
179
|
+
flunk 'Invalid Name'
|
177
180
|
end
|
178
181
|
end
|
179
|
-
|
180
182
|
end
|