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
@@ -5,42 +5,42 @@ require 'helper'
|
|
5
5
|
# Author: lawitschka<moritz.lawitschka@urbanvention.com>
|
6
6
|
class TestPhoneNumberDE < Test::Unit::TestCase
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::PhoneNumberDE
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_mobile_prefix
|
12
|
-
assert_match /^01[567]{1}[0-9]{1}$/,
|
12
|
+
assert_match /^01[567]{1}[0-9]{1}$/, FFaker::PhoneNumberDE.mobile_prefix
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_mobile_prefix_without_leading_zero
|
16
|
-
assert_match /^1[567]{1}[0-9]{1}$/,
|
16
|
+
assert_match /^1[567]{1}[0-9]{1}$/, FFaker::PhoneNumberDE.mobile_prefix(false)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_region_prefix
|
20
|
-
assert_match /^0[2-9]{1}[0-9]{1,3}$/,
|
20
|
+
assert_match /^0[2-9]{1}[0-9]{1,3}$/, FFaker::PhoneNumberDE.region_prefix
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_region_prefix_without_leading_zero
|
24
|
-
assert_match /^[2-9]{1}[0-9]{1,3}$/,
|
24
|
+
assert_match /^[2-9]{1}[0-9]{1,3}$/, FFaker::PhoneNumberDE.region_prefix(false)
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_mobile_phone_number
|
28
|
-
assert_match /^01[567]{1}[0-9]{1} [0-9]{7}$/,
|
28
|
+
assert_match /^01[567]{1}[0-9]{1} [0-9]{7}$/, FFaker::PhoneNumberDE.mobile_phone_number
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_home_work_phone_number
|
32
|
-
assert_match /^0[2-9]{1}[0-9]{1,3} [0-9]{7}$/,
|
32
|
+
assert_match /^0[2-9]{1}[0-9]{1,3} [0-9]{7}$/, FFaker::PhoneNumberDE.home_work_phone_number
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_country_code
|
36
|
-
assert_match '+49',
|
36
|
+
assert_match '+49', FFaker::PhoneNumberDE.country_code
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_international_mobile_phone_number
|
40
|
-
assert_match /^\+49 1[567]{1}[0-9]{1} [0-9]{7}$/,
|
40
|
+
assert_match /^\+49 1[567]{1}[0-9]{1} [0-9]{7}$/, FFaker::PhoneNumberDE.international_mobile_phone_number
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_international_home_work_phone_number
|
44
|
-
assert_match /^\+49 [2-9]{1}[0-9]{1,3} [0-9]{7}$/,
|
44
|
+
assert_match /^\+49 [2-9]{1}[0-9]{1,3} [0-9]{7}$/, FFaker::PhoneNumberDE.international_home_work_phone_number
|
45
45
|
end
|
46
46
|
end
|
@@ -5,53 +5,53 @@ require 'helper'
|
|
5
5
|
class TestPhoneNumberSE < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::PhoneNumberSE
|
9
9
|
end
|
10
10
|
|
11
11
|
ALLOWED_CHARS = /[()\d +-]/
|
12
12
|
|
13
13
|
def test_mobile_phone_prefix
|
14
|
-
assert
|
14
|
+
assert FFaker::PhoneNumberSE::MOBILE_PHONE_PREFIX.include?(@tester.mobile_prefix)
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_home_work_phone_prefix
|
18
|
-
assert
|
18
|
+
assert FFaker::PhoneNumberSE::PHONE_PREFIX.include?(@tester.area_prefix)
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_country_prefix
|
22
|
-
assert
|
22
|
+
assert FFaker::PhoneNumberSE::COUNTRY_PREFIX.include?(@tester.country_prefix)
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_mobile_phone_number
|
26
|
-
assert_match ALLOWED_CHARS,
|
27
|
-
assert_match(/\d{3}/,
|
28
|
-
assert
|
26
|
+
assert_match ALLOWED_CHARS, FFaker::PhoneNumberSE.mobile_phone_number
|
27
|
+
assert_match(/\d{3}/, FFaker::PhoneNumberSE.mobile_phone_number)
|
28
|
+
assert FFaker::PhoneNumberSE.mobile_phone_number.length > 9
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_home_work_phone_number
|
32
|
-
assert_match ALLOWED_CHARS,
|
33
|
-
assert_match(/\d{1} \d{2}/,
|
34
|
-
assert
|
32
|
+
assert_match ALLOWED_CHARS, FFaker::PhoneNumberSE.home_work_phone_number
|
33
|
+
assert_match(/\d{1} \d{2}/, FFaker::PhoneNumberSE.home_work_phone_number)
|
34
|
+
assert FFaker::PhoneNumberSE.mobile_phone_number.length > 9
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_phone_number
|
38
38
|
10.times do
|
39
|
-
assert_match ALLOWED_CHARS,
|
39
|
+
assert_match ALLOWED_CHARS, FFaker::PhoneNumberSE.phone_number
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_international_mobile_phone_number
|
44
|
-
assert_match(/46/,
|
44
|
+
assert_match(/46/, FFaker::PhoneNumberSE.international_mobile_phone_number)
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_international_home_work_phone_number
|
48
|
-
assert_match(/46/,
|
48
|
+
assert_match(/46/, FFaker::PhoneNumberSE.international_home_work_phone_number)
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_international_phone_number
|
52
52
|
10.times do
|
53
|
-
assert_match ALLOWED_CHARS,
|
54
|
-
assert_match(/46/,
|
53
|
+
assert_match ALLOWED_CHARS, FFaker::PhoneNumberSE.international_phone_number
|
54
|
+
assert_match(/46/, FFaker::PhoneNumberSE.international_phone_number)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -5,30 +5,30 @@ require 'helper'
|
|
5
5
|
# Author: xarala<pathe.sene@xarala.sn> http://www.xarala.sn
|
6
6
|
class TestPhoneNumberSN < Test::Unit::TestCase
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::PhoneNumberSN
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_mobile_phone_prefix
|
12
|
-
assert
|
12
|
+
assert FFaker::PhoneNumberSN::MobileOperatorsPrefix.include?(@tester.mobile_phone_prefix)
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_homework_phone_prefix
|
16
|
-
assert
|
16
|
+
assert FFaker::PhoneNumberSN::HomeWorkOperatorsPrefix.include?(@tester.homework_phone_prefix)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_short_phone_number
|
20
|
-
assert_match /\d{3}-\d{2}-\d{2}/,
|
20
|
+
assert_match /\d{3}-\d{2}-\d{2}/, FFaker::PhoneNumberSN.short_phone_number
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_mobile_phone_number
|
24
|
-
assert_match /(70|76|77)-\d{3}-\d{2}-\d{2}/,
|
24
|
+
assert_match /(70|76|77)-\d{3}-\d{2}-\d{2}/, FFaker::PhoneNumberSN.mobile_number
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_phone_number
|
28
|
-
assert_match /(33|70|76|77)-\d{3}-\d{2}-\d{2}/,
|
28
|
+
assert_match /(33|70|76|77)-\d{3}-\d{2}-\d{2}/, FFaker::PhoneNumberSN.phone_number
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_homework_phone_number
|
32
|
-
assert_match /(33)-(8|9)\d{2}-\d{2}-\d{2}/,
|
32
|
+
assert_match /(33)-(8|9)\d{2}-\d{2}-\d{2}/, FFaker::PhoneNumberSN.homework_number
|
33
33
|
end
|
34
34
|
end
|
data/test/test_skill.rb
CHANGED
@@ -5,20 +5,20 @@ require 'helper'
|
|
5
5
|
class TestSkill < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def test_tech_skill
|
8
|
-
assert_match /[a-z]+/i,
|
8
|
+
assert_match /[a-z]+/i, FFaker::Skill.tech_skill
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_tech_skills
|
12
|
-
tech_skills =
|
12
|
+
tech_skills = FFaker::Skill.tech_skills
|
13
13
|
assert_instance_of Array, tech_skills
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_specialty
|
17
|
-
assert_match /[ a-z]+/i,
|
17
|
+
assert_match /[ a-z]+/i, FFaker::Skill.specialty
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_specialties
|
21
|
-
specialties =
|
21
|
+
specialties = FFaker::Skill.specialties
|
22
22
|
assert_instance_of Array, specialties
|
23
23
|
end
|
24
24
|
end
|
data/test/test_ssn.rb
CHANGED
data/test/test_ssn_mx.rb
CHANGED
@@ -6,27 +6,27 @@ require 'helper'
|
|
6
6
|
class TestSSNMX < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def test_ssn
|
9
|
-
assert_match(/\d{10}-\d/,
|
9
|
+
assert_match(/\d{10}-\d/, FFaker::SSNMX.ssn)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def test_ssn_undashed
|
13
|
-
assert_match(/\d{11}/,
|
13
|
+
assert_match(/\d{11}/, FFaker::SSNMX.ssn_undashed)
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_imss
|
17
|
-
assert_match(/\d{10}-\d/,
|
17
|
+
assert_match(/\d{10}-\d/, FFaker::SSNMX.imss)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def test_imss_undashed
|
21
|
-
assert_match(/\d{11}/,
|
21
|
+
assert_match(/\d{11}/, FFaker::SSNMX.imss_undashed)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_issste
|
25
|
-
assert_match(/\d{10}-\d/,
|
25
|
+
assert_match(/\d{10}-\d/, FFaker::SSNMX.issste)
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def test_issste_undashed
|
29
|
-
assert_match(/\d{11}/,
|
29
|
+
assert_match(/\d{11}/, FFaker::SSNMX.issste_undashed)
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
end
|
data/test/test_ssn_se.rb
CHANGED
@@ -5,7 +5,7 @@ require 'helper'
|
|
5
5
|
class TestSSNSE < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def test_ssn_format
|
8
|
-
ssn =
|
8
|
+
ssn = FFaker::SSNSE.ssn
|
9
9
|
assert_match(/(19|20)\d{10}/, ssn, "With no arguments year should start with 19 or 20, #{ssn}")
|
10
10
|
end
|
11
11
|
|
@@ -14,14 +14,14 @@ class TestSSNSE < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_ssn_with_gender
|
17
|
-
ssn_male =
|
17
|
+
ssn_male = FFaker::SSNSE.ssn(gender: :male)
|
18
18
|
assert is_equal?(ssn_male[10].to_i)
|
19
19
|
|
20
|
-
ssn_female =
|
20
|
+
ssn_female = FFaker::SSNSE.ssn(gender: :female)
|
21
21
|
assert is_equal?(ssn_female[10].to_i)
|
22
22
|
|
23
23
|
assert_raise ArgumentError do
|
24
|
-
|
24
|
+
FFaker::SSNSE.ssn(gender: :unkown)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ class TestSSNSE < Test::Unit::TestCase
|
|
30
30
|
from = Time.local(1980, 2, 28)
|
31
31
|
to = Time.local(2000, 2, 28)
|
32
32
|
|
33
|
-
ssn =
|
33
|
+
ssn = FFaker::SSNSE.ssn(from: from, to: to)
|
34
34
|
year = ssn[0..3].to_i
|
35
35
|
month = ssn[4..5].to_i
|
36
36
|
day = ssn[6..7].to_i
|
data/test/test_string.rb
CHANGED
data/test/test_time.rb
CHANGED
data/test/test_units.rb
CHANGED
@@ -6,27 +6,27 @@ require 'helper'
|
|
6
6
|
class TestUnits < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
|
-
@tester =
|
9
|
+
@tester = FFaker::Unit
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_time_name
|
13
13
|
time_name = @tester.time_name
|
14
|
-
assert
|
14
|
+
assert FFaker::Unit::TIME_UNITS.any?{ |hash| hash[:name] == time_name }
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_time_abbr
|
18
18
|
time_abbr = @tester.time_abbr
|
19
|
-
assert
|
19
|
+
assert FFaker::Unit::TIME_UNITS.any?{ |hash| hash[:abbreviation] == time_abbr }
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_temperature_name
|
23
23
|
temperature_name = @tester.temperature_name
|
24
|
-
assert
|
24
|
+
assert FFaker::Unit::TEMPERATURE_UNITS.any?{ |hash| hash[:name] == temperature_name }
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_temperature_abbr
|
28
28
|
temperature_abbr = @tester.temperature_abbr
|
29
|
-
assert
|
29
|
+
assert FFaker::Unit::TEMPERATURE_UNITS.any?{ |hash| hash[:abbreviation] == temperature_abbr }
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
data/test/test_units_english.rb
CHANGED
@@ -6,57 +6,57 @@ require 'helper'
|
|
6
6
|
class TestUnitsEnglish < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
|
-
@tester =
|
9
|
+
@tester = FFaker::UnitEnglish
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_length_name
|
13
13
|
length_name = @tester.length_name
|
14
|
-
assert
|
14
|
+
assert FFaker::UnitEnglish::LENGTH_UNITS.any?{ |hash| hash[:name] == length_name }
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_length_abbrev
|
18
18
|
length_abbr = @tester.length_abbr
|
19
|
-
assert
|
19
|
+
assert FFaker::UnitEnglish::LENGTH_UNITS.any?{ |hash| hash[:abbreviation] == length_abbr }
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_mass_name
|
23
23
|
mass_name = @tester.mass_name
|
24
|
-
assert
|
24
|
+
assert FFaker::UnitEnglish::MASS_UNITS.any?{ |hash| hash[:name] == mass_name }
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_mass_abbr
|
28
28
|
mass_abbr = @tester.mass_abbr
|
29
|
-
assert
|
29
|
+
assert FFaker::UnitEnglish::MASS_UNITS.any?{ |hash| hash[:abbreviation] == mass_abbr }
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_liquid_name
|
33
33
|
liquid_name = @tester.liquid_name
|
34
|
-
assert
|
34
|
+
assert FFaker::UnitEnglish::LIQUID_UNITS.any?{ |hash| hash[:name] == liquid_name }
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_liquid_abbr
|
38
38
|
liquid_abbr = @tester.liquid_abbr
|
39
|
-
assert
|
39
|
+
assert FFaker::UnitEnglish::LIQUID_UNITS.any?{ |hash| hash[:abbreviation] == liquid_abbr }
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_volume_name
|
43
43
|
volume_name = @tester.volume_name
|
44
|
-
assert
|
44
|
+
assert FFaker::UnitEnglish::VOLUME_UNITS.any?{ |hash| hash[:name] == volume_name }
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_volume_abbr
|
48
48
|
volume_abbr = @tester.volume_abbr
|
49
|
-
assert
|
49
|
+
assert FFaker::UnitEnglish::VOLUME_UNITS.any?{ |hash| hash[:abbreviation] == volume_abbr }
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_area_name
|
53
53
|
area_name = @tester.area_name
|
54
|
-
assert
|
54
|
+
assert FFaker::UnitEnglish::AREA_UNITS.any?{ |hash| hash[:name] == area_name }
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_area_abbr
|
58
58
|
area_abbr = @tester.area_abbr
|
59
|
-
assert
|
59
|
+
assert FFaker::UnitEnglish::AREA_UNITS.any?{ |hash| hash[:abbreviation] == area_abbr }
|
60
60
|
end
|
61
61
|
|
62
62
|
end
|
data/test/test_units_metric.rb
CHANGED
@@ -5,57 +5,57 @@ require 'helper'
|
|
5
5
|
# Author: lurraca github.com/lurraca
|
6
6
|
class TestUnitsMetric < Test::Unit::TestCase
|
7
7
|
def setup
|
8
|
-
@tester =
|
8
|
+
@tester = FFaker::UnitMetric
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_length_name
|
12
12
|
length_name = @tester.length_name
|
13
|
-
assert
|
13
|
+
assert FFaker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:name] == length_name }
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_length_abbrev
|
17
17
|
length_abbr = @tester.length_abbr
|
18
|
-
assert
|
18
|
+
assert FFaker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:abbreviation] == length_abbr }
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_mass_name
|
22
22
|
mass_name = @tester.mass_name
|
23
|
-
assert
|
23
|
+
assert FFaker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:name] == mass_name }
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_mass_abbr
|
27
27
|
mass_abbr = @tester.mass_abbr
|
28
|
-
assert
|
28
|
+
assert FFaker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:abbreviation] == mass_abbr }
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_liquid_name
|
32
32
|
liquid_name = @tester.liquid_name
|
33
|
-
assert
|
33
|
+
assert FFaker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:name] == liquid_name }
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_liquid_abbr
|
37
37
|
liquid_abbr = @tester.liquid_abbr
|
38
|
-
assert
|
38
|
+
assert FFaker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:abbreviation] == liquid_abbr }
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_volume_name
|
42
42
|
volume_name = @tester.volume_name
|
43
|
-
assert
|
43
|
+
assert FFaker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:name] == volume_name }
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_volume_abbr
|
47
47
|
volume_abbr = @tester.volume_abbr
|
48
|
-
assert
|
48
|
+
assert FFaker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:abbreviation] == volume_abbr }
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_area_name
|
52
52
|
area_name = @tester.area_name
|
53
|
-
assert
|
53
|
+
assert FFaker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:name] == area_name }
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_area_abbr
|
57
57
|
area_abbr = @tester.area_abbr
|
58
|
-
assert
|
58
|
+
assert FFaker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:abbreviation] == area_abbr }
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|