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_food.rb
CHANGED
@@ -4,18 +4,18 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestFakerFood < Test::Unit::TestCase
|
6
6
|
def test_vegetable
|
7
|
-
assert_match /\A[-\/ íó'a-z0-9]+\z/i,
|
7
|
+
assert_match /\A[-\/ íó'a-z0-9]+\z/i, FFaker::Food.vegetable
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_fruit
|
11
|
-
assert_match /\A[ a-z0-9]+\z/i,
|
11
|
+
assert_match /\A[ a-z0-9]+\z/i, FFaker::Food.fruit
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_meat
|
15
|
-
assert_match /\A[, a-z0-9]+\z/i,
|
15
|
+
assert_match /\A[, a-z0-9]+\z/i, FFaker::Food.meat
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_herb_or_spice
|
19
|
-
assert_match /\A[-, a-z0-9]+\z/i,
|
19
|
+
assert_match /\A[-, a-z0-9]+\z/i, FFaker::Food.herb_or_spice
|
20
20
|
end
|
21
21
|
end
|
data/test/test_gender.rb
CHANGED
data/test/test_gender_cn.rb
CHANGED
data/test/test_gender_kr.rb
CHANGED
data/test/test_geolocation.rb
CHANGED
@@ -4,11 +4,11 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestGeolocation < Test::Unit::TestCase
|
6
6
|
def test_lat
|
7
|
-
assert_match /[0-9]+/,
|
7
|
+
assert_match /[0-9]+/, FFaker::Geolocation.lat.to_s
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_lng
|
11
|
-
assert_match /[0-9]+/,
|
11
|
+
assert_match /[0-9]+/, FFaker::Geolocation.lng.to_s
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_boxed_coords
|
@@ -24,7 +24,7 @@ class TestGeolocation < Test::Unit::TestCase
|
|
24
24
|
lon_min = [coords[0][1], coords[1][1]].min
|
25
25
|
lon_max = [coords[0][1], coords[1][1]].max
|
26
26
|
|
27
|
-
new_coords =
|
27
|
+
new_coords = FFaker::Geolocation.boxed_coords(coords[0], coords[1])
|
28
28
|
|
29
29
|
assert (lat_min..lat_max).include?new_coords[0]
|
30
30
|
assert (lon_min..lon_max).include?new_coords[1]
|
data/test/test_guid.rb
CHANGED
@@ -4,6 +4,6 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestGuid < Test::Unit::TestCase
|
6
6
|
def test_guid
|
7
|
-
assert_match /[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}/,
|
7
|
+
assert_match /[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}/, FFaker::Guid.guid
|
8
8
|
end
|
9
9
|
end
|
@@ -2,26 +2,26 @@ require 'helper'
|
|
2
2
|
|
3
3
|
class TestHealthcareIpsum < Test::Unit::TestCase
|
4
4
|
def test_paragraph
|
5
|
-
assert_match /1\+|[ a-z]+/i,
|
5
|
+
assert_match /1\+|[ a-z]+/i, FFaker::HealthcareIpsum.paragraph
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_sentence
|
9
|
-
assert_match /1\+|[ a-z]+/i,
|
9
|
+
assert_match /1\+|[ a-z]+/i, FFaker::HealthcareIpsum.sentence
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_paragraphs
|
13
|
-
assert_match /1\+|[ a-z]+/i,
|
13
|
+
assert_match /1\+|[ a-z]+/i, FFaker::HealthcareIpsum.paragraphs.join(" ")
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_sentences
|
17
|
-
assert_match /1\+|[ a-z]+/i,
|
17
|
+
assert_match /1\+|[ a-z]+/i, FFaker::HealthcareIpsum.sentences.join(" ")
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_words
|
21
|
-
assert_match /1\+|[ a-z]+/i,
|
21
|
+
assert_match /1\+|[ a-z]+/i, FFaker::HealthcareIpsum.words.join(" ")
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_word
|
25
|
-
assert_match /1\+|[a-z]+/i,
|
25
|
+
assert_match /1\+|[a-z]+/i, FFaker::HealthcareIpsum.word
|
26
26
|
end
|
27
27
|
end
|
data/test/test_hipster_ipsum.rb
CHANGED
@@ -6,26 +6,26 @@ class TestHipsterIpsum < Test::Unit::TestCase
|
|
6
6
|
TEST_REGEX = /\+1|[ a-z]+/i
|
7
7
|
|
8
8
|
def test_paragraph
|
9
|
-
assert_match TEST_REGEX,
|
9
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.paragraph
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_sentence
|
13
|
-
assert_match TEST_REGEX,
|
13
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.sentence
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_paragraphs
|
17
|
-
assert_match TEST_REGEX,
|
17
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.paragraphs.join(" ")
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_sentences
|
21
|
-
assert_match TEST_REGEX,
|
21
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.sentences.join(" ")
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_words
|
25
|
-
assert_match TEST_REGEX,
|
25
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.words.join(" ")
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_word
|
29
|
-
assert_match TEST_REGEX,
|
29
|
+
assert_match TEST_REGEX, FFaker::HipsterIpsum.word
|
30
30
|
end
|
31
31
|
end
|
data/test/test_html_ipsum.rb
CHANGED
@@ -4,31 +4,31 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestHTMLIpsum < Test::Unit::TestCase
|
6
6
|
def setup
|
7
|
-
@tester =
|
7
|
+
@tester = FFaker::HTMLIpsum
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_a
|
11
|
-
assert_match /^<a href="#\w+" title="[ \w]+">[ \w]+<\/a>$/i,
|
11
|
+
assert_match /^<a href="#\w+" title="[ \w]+">[ \w]+<\/a>$/i, FFaker::HTMLIpsum.a
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_p
|
15
15
|
# We can't predict the number of times the sentence pattern will repeat
|
16
|
-
# because the
|
16
|
+
# because the FFaker::Lorem methods that we are using adds a random
|
17
17
|
# number on top of what we specify for the count argument.
|
18
|
-
assert_match /^<p>([ \w]+\.)+<\/p>$/i,
|
18
|
+
assert_match /^<p>([ \w]+\.)+<\/p>$/i, FFaker::HTMLIpsum.p
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_p_breaks
|
22
22
|
# Here we can at least test how many <br> tags there are.
|
23
|
-
assert_match /^<p>(?:[ \w\.]+<br>){2}[ \w\.]+<\/p>$/i,
|
23
|
+
assert_match /^<p>(?:[ \w\.]+<br>){2}[ \w\.]+<\/p>$/i, FFaker::HTMLIpsum.p(3, {:include_breaks => true})
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_p_fancy
|
27
27
|
# We can't predict the number of times the sentence pattern will repeat
|
28
|
-
# because the
|
28
|
+
# because the FFaker::Lorem methods that we are using adds a random
|
29
29
|
# number on top of what we specify for the count argument. We also have to
|
30
30
|
# account for the other HTML that is being returned.
|
31
|
-
str =
|
31
|
+
str = FFaker::HTMLIpsum.p(5, {:fancy => true})
|
32
32
|
assert_match /^<p>/, str
|
33
33
|
assert_match /<\/p>$/, str
|
34
34
|
assert str.length > 6, "string contains more than <p></p>"
|
@@ -37,55 +37,55 @@ class TestHTMLIpsum < Test::Unit::TestCase
|
|
37
37
|
def test_p_fancy_breaks
|
38
38
|
# Here we can at least test how many <br> tags there are. We also have to
|
39
39
|
# account for the other HTML that is being returned.
|
40
|
-
str =
|
40
|
+
str = FFaker::HTMLIpsum.p(10, {:fancy => true, :include_breaks => true})
|
41
41
|
assert_equal 10, str.split("<br>").length
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_dl
|
45
|
-
assert_match /^<dl>(<dt>[ \w]+<\/dt><dd>[ \w.]+<\/dd>){3}<\/dl>$/i,
|
45
|
+
assert_match /^<dl>(<dt>[ \w]+<\/dt><dd>[ \w.]+<\/dd>){3}<\/dl>$/i, FFaker::HTMLIpsum.dl(3)
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_ul_short
|
49
|
-
assert_match /^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i,
|
49
|
+
assert_match /^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_short(3)
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_ul_long
|
53
|
-
assert_match /^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i,
|
53
|
+
assert_match /^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_long(3)
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_ol_short
|
57
|
-
assert_match /^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i,
|
57
|
+
assert_match /^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i, FFaker::HTMLIpsum.ol_short(3)
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_ol_long
|
61
|
-
assert_match /^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i,
|
61
|
+
assert_match /^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i, FFaker::HTMLIpsum.ol_long(3)
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_ul_links
|
65
|
-
assert_match /^<ul>(<li><a href="#\w+" title="\w+">[ \w]+<\/a><\/li>){3}<\/ul>$/i,
|
65
|
+
assert_match /^<ul>(<li><a href="#\w+" title="\w+">[ \w]+<\/a><\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_links(3)
|
66
66
|
end
|
67
67
|
|
68
68
|
def test_table
|
69
|
-
assert_match /(<td>[ \w]+<\/td>\s*){3}/i,
|
69
|
+
assert_match /(<td>[ \w]+<\/td>\s*){3}/i, FFaker::HTMLIpsum.table(3)
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_body
|
73
73
|
# We can't reliably predict what's going to end up inside, so just ensure
|
74
74
|
# that we have a complete string.
|
75
|
-
assert_match /^<h1>.+<\/pre>$/im,
|
75
|
+
assert_match /^<h1>.+<\/pre>$/im, FFaker::HTMLIpsum.body
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_fancy_string
|
79
79
|
# We can't reliably predict what's going to end up inside, so just ensure
|
80
80
|
# that we have a complete string.
|
81
|
-
assert
|
82
|
-
assert
|
81
|
+
assert FFaker::HTMLIpsum.fancy_string.is_a?(String), "returns a string"
|
82
|
+
assert FFaker::HTMLIpsum.fancy_string.length > 1, "the string is longer than one char"
|
83
83
|
end
|
84
84
|
|
85
85
|
def test_fancy_string_breaks
|
86
86
|
# We can't reliably predict what's going to end up inside, so just ensure
|
87
87
|
# that we have a complete string.
|
88
|
-
str =
|
88
|
+
str = FFaker::HTMLIpsum.fancy_string(3, true)
|
89
89
|
assert_equal 3, str.split("<br>").length
|
90
90
|
end
|
91
91
|
end
|
data/test/test_identification.rb
CHANGED
@@ -4,21 +4,21 @@ require 'helper'
|
|
4
4
|
|
5
5
|
# Author Guapolo <github.com/guapolo>
|
6
6
|
class TestIdentificationMX < Test::Unit::TestCase
|
7
|
-
|
7
|
+
|
8
8
|
def test_rfc_persona_moral
|
9
9
|
re = /\A[a-zñÑ&]{3}\d{2}[0-1][0-9][0-3][0-9][a-z0-9]{3}\z/i
|
10
|
-
assert_match(re,
|
10
|
+
assert_match(re, FFaker::IdentificationMX.rfc_persona_moral)
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def test_rfc_persona_fisica
|
14
14
|
re = /\A[a-zñÑ]{4}\d{2}[0-1][0-9][0-3][0-9][a-z0-9]{3}\z/i
|
15
|
-
assert_match(re,
|
15
|
+
assert_match(re, FFaker::IdentificationMX.rfc_persona_fisica)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_curp
|
19
|
-
or_curp_states_abbr =
|
19
|
+
or_curp_states_abbr = FFaker::IdentificationMX::ESTADOS_CURP.join("|")
|
20
20
|
re = /\A[a-z][aeioux][a-z]{2}[0-9]{2}[0-1][0-9][0-3][0-9][hm]#{or_curp_states_abbr}[bcdfghjklmnñpqrstvwxyz]{3}[0-9a-z][0-9]\z/i
|
21
|
-
assert_match(re,
|
21
|
+
assert_match(re, FFaker::IdentificationMX.curp)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
end
|
data/test/test_internet.rb
CHANGED
data/test/test_internet_se.rb
CHANGED
data/test/test_job.rb
CHANGED
data/test/test_job_fr.rb
CHANGED
data/test/test_job_ja.rb
CHANGED
data/test/test_job_kr.rb
CHANGED
data/test/test_lorem.rb
CHANGED
@@ -4,44 +4,44 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestLorem < Test::Unit::TestCase
|
6
6
|
def test_paragraph
|
7
|
-
assert_match /[ a-z]+/,
|
7
|
+
assert_match /[ a-z]+/, FFaker::Lorem.paragraph
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_sentence
|
11
|
-
assert_match /[ a-z]+/,
|
11
|
+
assert_match /[ a-z]+/, FFaker::Lorem.sentence
|
12
12
|
assert_nothing_thrown do
|
13
|
-
100.times {
|
13
|
+
100.times { FFaker::Lorem.sentence 0 }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_phrase
|
18
|
-
assert_match /[ a-z]+/,
|
18
|
+
assert_match /[ a-z]+/, FFaker::Lorem.phrase
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_paragraphs
|
22
|
-
assert_match /[ a-z]+/,
|
22
|
+
assert_match /[ a-z]+/, FFaker::Lorem.paragraphs.join(" ")
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_sentences
|
26
|
-
assert_match /[ a-z]+/,
|
26
|
+
assert_match /[ a-z]+/, FFaker::Lorem.sentences.join(" ")
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_phrases
|
30
|
-
assert_match /[ a-z]+/,
|
30
|
+
assert_match /[ a-z]+/, FFaker::Lorem.phrases.join(" ")
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_words
|
34
|
-
assert_match /[ a-z]+/,
|
34
|
+
assert_match /[ a-z]+/, FFaker::Lorem.words.join(" ")
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_word
|
38
|
-
assert_match /[a-z]+/,
|
38
|
+
assert_match /[a-z]+/, FFaker::Lorem.word
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_characters
|
42
|
-
assert_match /[a-z0-9]+/,
|
43
|
-
assert
|
44
|
-
assert
|
45
|
-
assert
|
42
|
+
assert_match /[a-z0-9]+/, FFaker::Lorem.characters
|
43
|
+
assert FFaker::Lorem.characters().length == 255
|
44
|
+
assert FFaker::Lorem.characters(10).length == 10
|
45
|
+
assert FFaker::Lorem.characters(-1) == ""
|
46
46
|
end
|
47
47
|
end
|
data/test/test_lorem_ar.rb
CHANGED
@@ -4,34 +4,34 @@ require 'helper'
|
|
4
4
|
|
5
5
|
class TestLoremARAR < Test::Unit::TestCase
|
6
6
|
def test_paragraph
|
7
|
-
assert_match /[ a-z]+/,
|
7
|
+
assert_match /[ a-z]+/, FFaker::LoremAR.paragraph
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_sentence
|
11
|
-
assert_match /[ a-z]+/,
|
11
|
+
assert_match /[ a-z]+/, FFaker::LoremAR.sentence
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_phrase
|
15
|
-
assert_match /[ a-z]+/,
|
15
|
+
assert_match /[ a-z]+/, FFaker::LoremAR.phrase
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_paragraphs
|
19
|
-
assert_match /[^a-zA-Z0-9]+/,
|
19
|
+
assert_match /[^a-zA-Z0-9]+/, FFaker::LoremAR.paragraphs.join(" ")
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_sentences
|
23
|
-
assert_match /[^a-zA-Z0-9]+/,
|
23
|
+
assert_match /[^a-zA-Z0-9]+/, FFaker::LoremAR.sentences.join(" ")
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_phrases
|
27
|
-
assert_match /[^a-zA-Z0-9]+/,
|
27
|
+
assert_match /[^a-zA-Z0-9]+/, FFaker::LoremAR.phrases.join(" ")
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_words
|
31
|
-
assert_match /[^a-zA-Z0-9]+/,
|
31
|
+
assert_match /[^a-zA-Z0-9]+/, FFaker::LoremAR.words.join(" ")
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_word
|
35
|
-
assert_match /[^a-zA-Z0-9]+/,
|
35
|
+
assert_match /[^a-zA-Z0-9]+/, FFaker::LoremAR.word
|
36
36
|
end
|
37
37
|
end
|