ffaker 2.18.0 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +25 -0
  3. data/REFERENCE.md +1463 -1352
  4. data/ffaker.gemspec +1 -4
  5. data/lib/ffaker/address_au.rb +1 -1
  6. data/lib/ffaker/address_br.rb +15 -3
  7. data/lib/ffaker/address_ca.rb +1 -1
  8. data/lib/ffaker/address_it.rb +36 -0
  9. data/lib/ffaker/address_mx.rb +2 -8
  10. data/lib/ffaker/animal_br.rb +12 -0
  11. data/lib/ffaker/company.rb +3 -6
  12. data/lib/ffaker/company_fr.rb +35 -0
  13. data/lib/ffaker/{courses.rb → courses_fr.rb} +2 -0
  14. data/lib/ffaker/data/address_br/city +0 -1
  15. data/lib/ffaker/data/address_br/complement +3 -0
  16. data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
  17. data/lib/ffaker/data/address_br/state +1 -1
  18. data/lib/ffaker/data/address_it/city +111 -0
  19. data/lib/ffaker/data/address_it/region +20 -0
  20. data/lib/ffaker/data/animal_br/common_names +423 -0
  21. data/lib/ffaker/data/food_pl/fermented +1 -1
  22. data/lib/ffaker/data/food_pl/fruits +1 -1
  23. data/lib/ffaker/data/food_pl/herbs +1 -1
  24. data/lib/ffaker/data/food_pl/meats +1 -1
  25. data/lib/ffaker/data/food_pl/preserves +1 -1
  26. data/lib/ffaker/data/food_pl/spices +1 -1
  27. data/lib/ffaker/data/food_pl/vegetables +1 -1
  28. data/lib/ffaker/data/game/adj_and_adv +18 -0
  29. data/lib/ffaker/data/game/category +84 -0
  30. data/lib/ffaker/data/game/mechanic +182 -0
  31. data/lib/ffaker/data/game/nouns +37 -0
  32. data/lib/ffaker/data/game/prefixes +17 -0
  33. data/lib/ffaker/data/job_it/job_adj +37 -0
  34. data/lib/ffaker/data/job_it/job_noun +25 -0
  35. data/lib/ffaker/data/job_it/job_prefix +22 -0
  36. data/lib/ffaker/data/lorem_br/characters +36 -0
  37. data/lib/ffaker/data/lorem_br/words +183 -0
  38. data/lib/ffaker/data/lorem_it/words +321 -0
  39. data/lib/ffaker/data/name/pronouns +1 -1
  40. data/lib/ffaker/data/name_ga/first_names_male +286 -286
  41. data/lib/ffaker/data/sport_ru/summer +68 -0
  42. data/lib/ffaker/data/sport_ru/winter +20 -0
  43. data/lib/ffaker/freedom_ipsum.rb +1 -1
  44. data/lib/ffaker/game.rb +33 -0
  45. data/lib/ffaker/gender_it.rb +17 -0
  46. data/lib/ffaker/gender_ru.rb +22 -0
  47. data/lib/ffaker/html_ipsum.rb +7 -1
  48. data/lib/ffaker/identification_it.rb +30 -0
  49. data/lib/ffaker/identification_tw.rb +3 -2
  50. data/lib/ffaker/job_it.rb +12 -0
  51. data/lib/ffaker/lorem_br.rb +45 -0
  52. data/lib/ffaker/lorem_it.rb +39 -0
  53. data/lib/ffaker/name_th_en.rb +1 -1
  54. data/lib/ffaker/number.rb +26 -0
  55. data/lib/ffaker/phone_number_it.rb +8 -6
  56. data/lib/ffaker/sport_ru.rb +25 -0
  57. data/lib/ffaker/ssn_se.rb +0 -19
  58. data/lib/ffaker/string.rb +6 -6
  59. data/lib/ffaker/time.rb +1 -1
  60. data/lib/ffaker/utils/array_utils.rb +1 -1
  61. data/lib/ffaker/utils/module_utils.rb +23 -3
  62. data/lib/ffaker/utils/unique_utils.rb +1 -0
  63. data/lib/ffaker/vehicle.rb +63 -1
  64. data/lib/ffaker.rb +15 -3
  65. data/lib/version.rb +1 -1
  66. data/scripts/profiling.rb +1 -1
  67. data/scripts/reference.rb +16 -15
  68. data/test/helper.rb +1 -1
  69. data/test/test_address.rb +1 -1
  70. data/test/test_address_au.rb +1 -1
  71. data/test/test_address_br.rb +16 -3
  72. data/test/test_address_ca.rb +1 -1
  73. data/test/test_address_ch.rb +1 -1
  74. data/test/test_address_ch_de.rb +1 -1
  75. data/test/test_address_ch_fr.rb +1 -1
  76. data/test/test_address_ch_it.rb +1 -1
  77. data/test/test_address_da.rb +1 -1
  78. data/test/test_address_de.rb +1 -1
  79. data/test/test_address_fi.rb +1 -1
  80. data/test/test_address_fr.rb +1 -1
  81. data/test/test_address_gr.rb +1 -1
  82. data/test/test_address_id.rb +1 -1
  83. data/test/test_address_in.rb +1 -1
  84. data/test/test_address_it.rb +12 -0
  85. data/test/test_address_ja.rb +1 -1
  86. data/test/test_address_kr.rb +1 -1
  87. data/test/test_address_mx.rb +1 -1
  88. data/test/test_address_nl.rb +1 -1
  89. data/test/test_address_pl.rb +1 -1
  90. data/test/test_address_ru.rb +1 -1
  91. data/test/test_address_se.rb +1 -1
  92. data/test/test_address_sn.rb +1 -1
  93. data/test/test_address_ua.rb +1 -1
  94. data/test/test_address_uk.rb +1 -1
  95. data/test/test_address_us.rb +1 -1
  96. data/test/test_airline.rb +1 -1
  97. data/test/test_animal.rb +1 -1
  98. data/test/test_animal_br.rb +17 -0
  99. data/test/test_animal_cn.rb +1 -1
  100. data/test/test_animal_es.rb +1 -1
  101. data/test/test_animal_pl.rb +1 -1
  102. data/test/test_animal_us.rb +1 -1
  103. data/test/test_array_utils.rb +2 -1
  104. data/test/test_avatar.rb +1 -1
  105. data/test/test_aws.rb +1 -1
  106. data/test/test_bacon_ipsum.rb +1 -1
  107. data/test/test_bank.rb +1 -1
  108. data/test/test_book.rb +1 -1
  109. data/test/test_boolean.rb +1 -1
  110. data/test/test_cheesy_lingo.rb +1 -1
  111. data/test/test_code.rb +1 -1
  112. data/test/test_color.rb +1 -1
  113. data/test/test_color_pl.rb +1 -1
  114. data/test/test_color_ua.rb +1 -1
  115. data/test/test_company.rb +1 -1
  116. data/test/test_company_cn.rb +1 -1
  117. data/test/test_company_fr.rb +33 -0
  118. data/test/test_company_it.rb +1 -1
  119. data/test/test_company_ja.rb +1 -1
  120. data/test/test_company_se.rb +1 -1
  121. data/test/test_conference.rb +1 -1
  122. data/test/test_course_mathematiques.rb +1 -1
  123. data/test/test_course_philosophie.rb +1 -1
  124. data/test/test_currency.rb +1 -1
  125. data/test/test_dizzle_ipsum.rb +1 -1
  126. data/test/test_education.rb +1 -1
  127. data/test/test_education_cn.rb +1 -1
  128. data/test/test_ffaker.rb +1 -1
  129. data/test/test_filesystem.rb +1 -1
  130. data/test/test_food.rb +1 -1
  131. data/test/test_food_pl.rb +1 -1
  132. data/test/test_freedom_ipsum.rb +1 -1
  133. data/test/test_game.rb +28 -0
  134. data/test/test_gender.rb +2 -2
  135. data/test/test_gender_br.rb +1 -1
  136. data/test/test_gender_cn.rb +1 -1
  137. data/test/test_gender_id.rb +1 -1
  138. data/test/test_gender_it.rb +27 -0
  139. data/test/test_gender_ja.rb +1 -1
  140. data/test/test_gender_jp.rb +1 -1
  141. data/test/test_gender_kr.rb +1 -1
  142. data/test/test_gender_pl.rb +1 -1
  143. data/test/test_gender_ru.rb +23 -0
  144. data/test/test_geolocation.rb +1 -1
  145. data/test/test_guid.rb +1 -1
  146. data/test/test_healthcare_ipsum.rb +1 -1
  147. data/test/test_healthcare_ru.rb +1 -1
  148. data/test/test_hipster_ipsum.rb +1 -1
  149. data/test/test_html_ipsum.rb +7 -1
  150. data/test/test_identification.rb +1 -1
  151. data/test/test_identification_br.rb +1 -1
  152. data/test/test_identification_co.rb +1 -1
  153. data/test/test_identification_es.rb +1 -1
  154. data/test/test_identification_es_cl.rb +1 -1
  155. data/test/test_identification_es_mx.rb +1 -1
  156. data/test/test_identification_in.rb +1 -1
  157. data/test/test_identification_it.rb +34 -0
  158. data/test/test_identification_kr.rb +1 -1
  159. data/test/test_identification_tw.rb +1 -1
  160. data/test/test_image.rb +1 -1
  161. data/test/test_internet.rb +1 -1
  162. data/test/test_internet_se.rb +1 -1
  163. data/test/test_job.rb +1 -1
  164. data/test/test_job_br.rb +1 -1
  165. data/test/test_job_cn.rb +1 -1
  166. data/test/test_job_fr.rb +1 -1
  167. data/test/test_job_it.rb +17 -0
  168. data/test/test_job_ja.rb +1 -1
  169. data/test/test_job_kr.rb +1 -1
  170. data/test/test_job_vn.rb +1 -1
  171. data/test/test_locale.rb +1 -1
  172. data/test/test_lorem.rb +1 -1
  173. data/test/test_lorem_ar.rb +1 -1
  174. data/test/test_lorem_br.rb +62 -0
  175. data/test/test_lorem_cn.rb +1 -1
  176. data/test/test_lorem_fr.rb +1 -1
  177. data/test/test_lorem_ie.rb +1 -1
  178. data/test/test_lorem_it.rb +51 -0
  179. data/test/test_lorem_ja.rb +1 -1
  180. data/test/test_lorem_kr.rb +1 -1
  181. data/test/test_lorem_pl.rb +1 -1
  182. data/test/test_lorem_ru.rb +1 -1
  183. data/test/test_lorem_ua.rb +1 -1
  184. data/test/test_module_utils.rb +1 -1
  185. data/test/test_movie.rb +1 -1
  186. data/test/test_music.rb +1 -1
  187. data/test/test_name.rb +1 -1
  188. data/test/test_name_ar.rb +1 -1
  189. data/test/test_name_br.rb +1 -1
  190. data/test/test_name_cn.rb +1 -1
  191. data/test/test_name_cs.rb +1 -1
  192. data/test/test_name_da.rb +1 -1
  193. data/test/test_name_de.rb +1 -1
  194. data/test/test_name_es.rb +1 -1
  195. data/test/test_name_fr.rb +1 -1
  196. data/test/test_name_ga.rb +1 -1
  197. data/test/test_name_gr.rb +1 -1
  198. data/test/test_name_id.rb +1 -1
  199. data/test/test_name_it.rb +1 -1
  200. data/test/test_name_ja.rb +1 -1
  201. data/test/test_name_kh.rb +1 -1
  202. data/test/test_name_kr.rb +1 -1
  203. data/test/test_name_mx.rb +1 -1
  204. data/test/test_name_nb.rb +1 -1
  205. data/test/test_name_nl.rb +1 -1
  206. data/test/test_name_ph.rb +1 -1
  207. data/test/test_name_pl.rb +1 -1
  208. data/test/test_name_ru.rb +1 -1
  209. data/test/test_name_se.rb +1 -1
  210. data/test/test_name_sn.rb +1 -1
  211. data/test/test_name_th.rb +1 -1
  212. data/test/test_name_th_en.rb +1 -1
  213. data/test/test_name_tw.rb +1 -1
  214. data/test/test_name_ua.rb +1 -1
  215. data/test/test_name_vn.rb +1 -1
  216. data/test/test_nato_alphabet.rb +1 -1
  217. data/test/test_number.rb +45 -0
  218. data/test/test_phone_number.rb +1 -1
  219. data/test/test_phone_number_au.rb +1 -1
  220. data/test/test_phone_number_br.rb +1 -1
  221. data/test/test_phone_number_cu.rb +1 -1
  222. data/test/test_phone_number_da.rb +1 -1
  223. data/test/test_phone_number_de.rb +1 -1
  224. data/test/test_phone_number_fr.rb +1 -1
  225. data/test/test_phone_number_id.rb +1 -1
  226. data/test/test_phone_number_it.rb +12 -0
  227. data/test/test_phone_number_ja.rb +1 -1
  228. data/test/test_phone_number_kr.rb +1 -1
  229. data/test/test_phone_number_mx.rb +1 -1
  230. data/test/test_phone_number_nl.rb +1 -1
  231. data/test/test_phone_number_pl.rb +1 -1
  232. data/test/test_phone_number_se.rb +1 -1
  233. data/test/test_phone_number_sg.rb +1 -1
  234. data/test/test_phone_number_sn.rb +1 -1
  235. data/test/test_phone_number_tw.rb +1 -1
  236. data/test/test_phone_number_ua.rb +1 -1
  237. data/test/test_products.rb +1 -1
  238. data/test/test_sem_ver.rb +1 -1
  239. data/test/test_skill.rb +1 -1
  240. data/test/test_sport_pl.rb +1 -1
  241. data/test/test_sport_ru.rb +30 -0
  242. data/test/test_sport_us.rb +1 -1
  243. data/test/test_sports.rb +1 -1
  244. data/test/test_ssn.rb +1 -1
  245. data/test/test_ssn_mx.rb +1 -1
  246. data/test/test_ssn_se.rb +1 -1
  247. data/test/test_string.rb +1 -1
  248. data/test/test_time.rb +1 -1
  249. data/test/test_tweet.rb +1 -1
  250. data/test/test_unique_utils.rb +1 -1
  251. data/test/test_units.rb +2 -1
  252. data/test/test_units_english.rb +1 -1
  253. data/test/test_units_metric.rb +1 -1
  254. data/test/test_vehicle.rb +7 -2
  255. data/test/test_venue.rb +1 -1
  256. data/test/test_youtube.rb +1 -1
  257. metadata +216 -160
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestLoremIT < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::LoremIT,
10
+ :paragraph, :sentence, :phrase, :paragraphs, :sentences, :phrases, :words, :word
11
+ )
12
+
13
+ def test_paragraph
14
+ assert_match(/[ a-z]+/, FFaker::LoremIT.paragraph)
15
+ end
16
+
17
+ def test_sentence
18
+ assert_match(/[ a-z]+/, FFaker::LoremIT.sentence)
19
+ assert_nothing_thrown do
20
+ 100.times { FFaker::LoremIT.sentence 0 }
21
+ end
22
+ end
23
+
24
+ def test_phrase
25
+ assert_match(/[ a-z]+/, FFaker::LoremIT.phrase)
26
+ end
27
+
28
+ def test_paragraphs
29
+ assert_match(/[ a-z]+/, FFaker::LoremIT.paragraphs.join(' '))
30
+ end
31
+
32
+ def test_sentences
33
+ assert_match(/[ a-z]+/, FFaker::LoremIT.sentences.join(' '))
34
+ end
35
+
36
+ def test_phrases
37
+ assert_match(/[ a-z]+/, FFaker::LoremIT.phrases.join(' '))
38
+ end
39
+
40
+ def test_words
41
+ assert_match(/[ a-z]+/, FFaker::LoremIT.words.join(' '))
42
+ end
43
+
44
+ def test_word
45
+ assert_match(/[a-z]+/, FFaker::LoremIT.word)
46
+ end
47
+
48
+ def test_word_collection_uniqueness
49
+ assert_equal(FFaker::LoremIT::WORDS, FFaker::LoremIT::WORDS.uniq)
50
+ end
51
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestLoremJA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestLoremKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerLoremPL < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestLoremRU < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestLoremUA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestModuleUtils < Test::Unit::TestCase
6
6
  def test_provides_a_k_method_for_generating_constant_arrays
data/test/test_movie.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestMovie < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_music.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestMusic < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerName < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ar.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameAR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_br.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameBR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_cn.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameCN < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_cs.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameCS < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_da.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameDA < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_de.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameDE < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_es.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameES < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_fr.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameFR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ga.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameGa < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_gr.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameGR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_id.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameID < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_it.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameIT < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ja.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameJA < Test::Unit::TestCase
6
6
  class << self
data/test/test_name_kh.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameKH < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_kr.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_mx.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameMX < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_nb.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameNB < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_nl.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameNL < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ph.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNamePH < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_pl.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNamePL < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ru.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestNameRU < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_se.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameSE < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_sn.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameSn < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_th.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameTH < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameTHEN < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_tw.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerNameTW < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ua.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestNameUA < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_vn.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestNameVN < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestNato < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestNumber < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(FFaker::Number, :number, :decimal)
9
+
10
+ def setup
11
+ @tester = FFaker::Number
12
+ end
13
+
14
+ def test_number
15
+ assert @tester.number.is_a?(Integer)
16
+ assert @tester.number.digits.count == 1
17
+ assert @tester.number(digits: 3).digits.count == 3
18
+ assert_match(/\d/, @tester.number.to_s)
19
+ assert_match(/\d{3}/, @tester.number(digits: 3).to_s)
20
+ end
21
+
22
+ def test_number_when_invalid_argument
23
+ assert_raise(ArgumentError.new('Digits cannot be less than 1')) { @tester.number(digits: 0) }
24
+ end
25
+
26
+ def test_decimal
27
+ assert @tester.decimal.is_a?(Float)
28
+
29
+ whole_digits = rand(2..5)
30
+ fractional_digits = rand(2..5)
31
+ decimal = @tester.decimal(whole_digits: whole_digits, fractional_digits: fractional_digits)
32
+ assert decimal.to_s.split('.').first.size == whole_digits
33
+ assert decimal.to_s.split('.').last.size == fractional_digits
34
+ end
35
+
36
+ def test_decimal_when_invalid_argument
37
+ assert_raise(ArgumentError.new('Digits cannot be less than 1')) do
38
+ @tester.decimal(whole_digits: 0)
39
+ end
40
+
41
+ assert_raise(ArgumentError.new('Digits cannot be less than 1')) do
42
+ @tester.decimal(fractional_digits: 0)
43
+ end
44
+ end
45
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumber < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberAU < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberBR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberCU < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberDA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberDE < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberFR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberID < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestPhoneNumberIT < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::PhoneNumberIT,
10
+ :phone_number, :home_phone_number, :mobile_phone_number
11
+ )
12
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberJA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberMX < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberNL < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberPL < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberSE < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberSG < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberSN < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberTW < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestPhoneNumberUA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestProducts < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_sem_ver.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestSemVer < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_skill.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestSkill < Test::Unit::TestCase
6
6
  include DeterministicHelper