ffaker 2.16.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +32 -0
  3. data/README.md +6 -4
  4. data/REFERENCE.md +1484 -1257
  5. data/Rakefile +3 -3
  6. data/ffaker.gemspec +4 -7
  7. data/lib/ffaker/address_au.rb +1 -1
  8. data/lib/ffaker/address_br.rb +1 -1
  9. data/lib/ffaker/address_ca.rb +1 -1
  10. data/lib/ffaker/address_ch.rb +0 -2
  11. data/lib/ffaker/address_ch_de.rb +0 -2
  12. data/lib/ffaker/address_ch_fr.rb +0 -2
  13. data/lib/ffaker/address_ch_it.rb +0 -2
  14. data/lib/ffaker/address_da.rb +0 -2
  15. data/lib/ffaker/address_de.rb +0 -2
  16. data/lib/ffaker/address_fi.rb +0 -2
  17. data/lib/ffaker/address_fr.rb +0 -2
  18. data/lib/ffaker/address_gr.rb +0 -2
  19. data/lib/ffaker/address_id.rb +0 -2
  20. data/lib/ffaker/address_in.rb +0 -2
  21. data/lib/ffaker/address_it.rb +37 -0
  22. data/lib/ffaker/address_ja.rb +0 -2
  23. data/lib/ffaker/address_mx.rb +2 -8
  24. data/lib/ffaker/address_nl.rb +0 -2
  25. data/lib/ffaker/address_ru.rb +0 -2
  26. data/lib/ffaker/address_se.rb +0 -2
  27. data/lib/ffaker/address_sn.rb +0 -2
  28. data/lib/ffaker/address_ua.rb +0 -2
  29. data/lib/ffaker/address_uk.rb +0 -2
  30. data/lib/ffaker/address_us.rb +0 -2
  31. data/lib/ffaker/animal.rb +1 -1
  32. data/lib/ffaker/bacon_ipsum.rb +0 -2
  33. data/lib/ffaker/company_fr.rb +35 -0
  34. data/lib/ffaker/{courses.rb → courses_fr.rb} +2 -0
  35. data/lib/ffaker/data/address_br/city +0 -1
  36. data/lib/ffaker/data/address_br/state +1 -1
  37. data/lib/ffaker/data/address_it/city +111 -0
  38. data/lib/ffaker/data/address_it/region +20 -0
  39. data/lib/ffaker/data/filesystem/extension +31 -31
  40. data/lib/ffaker/data/food_pl/diary +14 -0
  41. data/lib/ffaker/data/food_pl/fermented +13 -0
  42. data/lib/ffaker/data/food_pl/fruits +34 -0
  43. data/lib/ffaker/data/food_pl/herbs +20 -0
  44. data/lib/ffaker/data/food_pl/meats +9 -0
  45. data/lib/ffaker/data/food_pl/preserves +10 -0
  46. data/lib/ffaker/data/food_pl/spices +26 -0
  47. data/lib/ffaker/data/food_pl/vegetables +45 -0
  48. data/lib/ffaker/data/freedom_ipsum/freedom_words +161 -0
  49. data/lib/ffaker/data/game/adj_and_adv +18 -0
  50. data/lib/ffaker/data/game/category +84 -0
  51. data/lib/ffaker/data/game/mechanic +182 -0
  52. data/lib/ffaker/data/game/nouns +37 -0
  53. data/lib/ffaker/data/game/prefixes +17 -0
  54. data/lib/ffaker/data/job_it/job_adj +37 -0
  55. data/lib/ffaker/data/job_it/job_noun +25 -0
  56. data/lib/ffaker/data/job_it/job_prefix +22 -0
  57. data/lib/ffaker/data/lorem/words +0 -67
  58. data/lib/ffaker/data/lorem_br/characters +36 -0
  59. data/lib/ffaker/data/lorem_br/words +183 -0
  60. data/lib/ffaker/data/lorem_it/words +321 -0
  61. data/lib/ffaker/data/name/pronouns +1 -1
  62. data/lib/ffaker/data/name_ga/first_names_male +286 -286
  63. data/lib/ffaker/data/phone_number_ja/four_disit_area_codes +41 -0
  64. data/lib/ffaker/data/phone_number_ja/one_disit_area_codes +3 -0
  65. data/lib/ffaker/data/phone_number_ja/three_disit_area_codes +296 -0
  66. data/lib/ffaker/data/phone_number_ja/two_disit_area_codes +48 -0
  67. data/lib/ffaker/data/sport_ru/summer +68 -0
  68. data/lib/ffaker/data/sport_ru/winter +20 -0
  69. data/lib/ffaker/dizzle_ipsum.rb +0 -2
  70. data/lib/ffaker/filesystem.rb +7 -7
  71. data/lib/ffaker/food_pl.rb +65 -0
  72. data/lib/ffaker/freedom_ipsum.rb +20 -0
  73. data/lib/ffaker/game.rb +33 -0
  74. data/lib/ffaker/gender_it.rb +17 -0
  75. data/lib/ffaker/gender_ru.rb +22 -0
  76. data/lib/ffaker/healthcare_ipsum.rb +0 -2
  77. data/lib/ffaker/hipster_ipsum.rb +0 -2
  78. data/lib/ffaker/identification_es_cl.rb +0 -2
  79. data/lib/ffaker/identification_es_co.rb +0 -1
  80. data/lib/ffaker/identification_it.rb +30 -0
  81. data/lib/ffaker/identification_kr.rb +1 -1
  82. data/lib/ffaker/identification_mx.rb +1 -3
  83. data/lib/ffaker/image.rb +8 -11
  84. data/lib/ffaker/internet.rb +1 -1
  85. data/lib/ffaker/internet_se.rb +1 -3
  86. data/lib/ffaker/job_it.rb +12 -0
  87. data/lib/ffaker/lorem_br.rb +45 -0
  88. data/lib/ffaker/lorem_cn.rb +0 -1
  89. data/lib/ffaker/lorem_it.rb +39 -0
  90. data/lib/ffaker/name_cs.rb +0 -2
  91. data/lib/ffaker/name_da.rb +0 -2
  92. data/lib/ffaker/name_de.rb +0 -2
  93. data/lib/ffaker/name_mx.rb +0 -2
  94. data/lib/ffaker/name_nb.rb +0 -2
  95. data/lib/ffaker/name_nl.rb +0 -2
  96. data/lib/ffaker/name_ph.rb +0 -2
  97. data/lib/ffaker/name_ru.rb +0 -2
  98. data/lib/ffaker/name_se.rb +0 -2
  99. data/lib/ffaker/name_th_en.rb +1 -1
  100. data/lib/ffaker/name_ua.rb +0 -2
  101. data/lib/ffaker/number.rb +26 -0
  102. data/lib/ffaker/phone_number_br.rb +2 -2
  103. data/lib/ffaker/phone_number_da.rb +0 -1
  104. data/lib/ffaker/phone_number_it.rb +8 -6
  105. data/lib/ffaker/phone_number_ja.rb +88 -0
  106. data/lib/ffaker/sport_ru.rb +25 -0
  107. data/lib/ffaker/ssn.rb +1 -3
  108. data/lib/ffaker/ssn_se.rb +0 -19
  109. data/lib/ffaker/string.rb +4 -4
  110. data/lib/ffaker/unit.rb +9 -10
  111. data/lib/ffaker/unit_english.rb +18 -21
  112. data/lib/ffaker/unit_metric.rb +15 -18
  113. data/lib/ffaker/utils/array_utils.rb +1 -1
  114. data/lib/ffaker/utils/module_utils.rb +23 -3
  115. data/lib/ffaker/vehicle.rb +1 -1
  116. data/lib/ffaker.rb +19 -4
  117. data/lib/version.rb +1 -1
  118. data/scripts/profiling.rb +1 -1
  119. data/scripts/reference.rb +2 -3
  120. data/test/helper.rb +4 -4
  121. data/test/test_address.rb +1 -1
  122. data/test/test_address_au.rb +3 -3
  123. data/test/test_address_br.rb +2 -2
  124. data/test/test_address_ca.rb +1 -1
  125. data/test/test_address_ch.rb +1 -1
  126. data/test/test_address_ch_de.rb +1 -1
  127. data/test/test_address_ch_fr.rb +1 -1
  128. data/test/test_address_ch_it.rb +1 -1
  129. data/test/test_address_da.rb +1 -1
  130. data/test/test_address_de.rb +1 -1
  131. data/test/test_address_fi.rb +3 -3
  132. data/test/test_address_fr.rb +1 -1
  133. data/test/test_address_gr.rb +1 -1
  134. data/test/test_address_id.rb +2 -2
  135. data/test/test_address_in.rb +1 -1
  136. data/test/test_address_it.rb +12 -0
  137. data/test/test_address_ja.rb +2 -2
  138. data/test/test_address_kr.rb +1 -1
  139. data/test/test_address_mx.rb +1 -1
  140. data/test/test_address_nl.rb +1 -1
  141. data/test/test_address_pl.rb +1 -1
  142. data/test/test_address_ru.rb +1 -1
  143. data/test/test_address_se.rb +3 -3
  144. data/test/test_address_sn.rb +1 -1
  145. data/test/test_address_ua.rb +1 -1
  146. data/test/test_address_uk.rb +1 -1
  147. data/test/test_address_us.rb +1 -1
  148. data/test/test_airline.rb +1 -1
  149. data/test/test_animal.rb +1 -1
  150. data/test/test_animal_cn.rb +1 -1
  151. data/test/test_animal_es.rb +1 -1
  152. data/test/test_animal_pl.rb +1 -1
  153. data/test/test_animal_us.rb +1 -1
  154. data/test/test_array_utils.rb +2 -1
  155. data/test/test_avatar.rb +1 -1
  156. data/test/test_aws.rb +2 -2
  157. data/test/test_bacon_ipsum.rb +1 -1
  158. data/test/test_bank.rb +3 -4
  159. data/test/test_book.rb +5 -5
  160. data/test/test_boolean.rb +1 -1
  161. data/test/test_cheesy_lingo.rb +1 -1
  162. data/test/test_code.rb +1 -1
  163. data/test/test_color.rb +1 -1
  164. data/test/test_color_pl.rb +1 -1
  165. data/test/test_color_ua.rb +1 -1
  166. data/test/test_company.rb +1 -1
  167. data/test/test_company_cn.rb +1 -1
  168. data/test/test_company_fr.rb +33 -0
  169. data/test/test_company_it.rb +1 -1
  170. data/test/test_company_ja.rb +1 -1
  171. data/test/test_company_se.rb +1 -1
  172. data/test/test_conference.rb +1 -1
  173. data/test/test_course_mathematiques.rb +1 -1
  174. data/test/test_course_philosophie.rb +1 -1
  175. data/test/test_currency.rb +1 -1
  176. data/test/test_dizzle_ipsum.rb +1 -1
  177. data/test/test_education.rb +1 -1
  178. data/test/test_education_cn.rb +1 -1
  179. data/test/{test_faker.rb → test_ffaker.rb} +6 -2
  180. data/test/test_filesystem.rb +12 -4
  181. data/test/test_food.rb +1 -1
  182. data/test/test_food_pl.rb +61 -0
  183. data/test/test_freedom_ipsum.rb +21 -0
  184. data/test/test_game.rb +28 -0
  185. data/test/test_gender.rb +2 -2
  186. data/test/test_gender_br.rb +1 -1
  187. data/test/test_gender_cn.rb +1 -1
  188. data/test/test_gender_id.rb +1 -1
  189. data/test/test_gender_it.rb +27 -0
  190. data/test/test_gender_ja.rb +1 -1
  191. data/test/test_gender_jp.rb +1 -1
  192. data/test/test_gender_kr.rb +1 -1
  193. data/test/test_gender_pl.rb +1 -1
  194. data/test/test_gender_ru.rb +23 -0
  195. data/test/test_geolocation.rb +1 -1
  196. data/test/test_guid.rb +1 -1
  197. data/test/test_healthcare_ipsum.rb +1 -1
  198. data/test/test_healthcare_ru.rb +2 -2
  199. data/test/test_hipster_ipsum.rb +1 -1
  200. data/test/test_html_ipsum.rb +2 -2
  201. data/test/test_identification.rb +1 -1
  202. data/test/test_identification_br.rb +1 -1
  203. data/test/test_identification_co.rb +2 -2
  204. data/test/test_identification_es.rb +1 -1
  205. data/test/test_identification_es_cl.rb +2 -2
  206. data/test/test_identification_es_mx.rb +1 -1
  207. data/test/test_identification_in.rb +1 -1
  208. data/test/test_identification_it.rb +34 -0
  209. data/test/test_identification_kr.rb +1 -1
  210. data/test/test_identification_tw.rb +1 -1
  211. data/test/test_image.rb +5 -5
  212. data/test/test_internet.rb +1 -1
  213. data/test/test_internet_se.rb +2 -2
  214. data/test/test_job.rb +1 -1
  215. data/test/test_job_br.rb +1 -1
  216. data/test/test_job_cn.rb +1 -1
  217. data/test/test_job_fr.rb +1 -1
  218. data/test/test_job_it.rb +17 -0
  219. data/test/test_job_ja.rb +1 -1
  220. data/test/test_job_kr.rb +1 -1
  221. data/test/test_job_vn.rb +1 -1
  222. data/test/test_locale.rb +1 -1
  223. data/test/test_lorem.rb +5 -1
  224. data/test/test_lorem_ar.rb +1 -1
  225. data/test/test_lorem_br.rb +62 -0
  226. data/test/test_lorem_cn.rb +1 -1
  227. data/test/test_lorem_fr.rb +10 -8
  228. data/test/test_lorem_ie.rb +1 -1
  229. data/test/test_lorem_it.rb +51 -0
  230. data/test/test_lorem_ja.rb +1 -1
  231. data/test/test_lorem_kr.rb +1 -1
  232. data/test/test_lorem_pl.rb +2 -2
  233. data/test/test_lorem_ru.rb +2 -2
  234. data/test/test_lorem_ua.rb +2 -2
  235. data/test/test_module_utils.rb +1 -1
  236. data/test/test_movie.rb +1 -1
  237. data/test/test_music.rb +5 -5
  238. data/test/test_name.rb +1 -1
  239. data/test/test_name_ar.rb +1 -1
  240. data/test/test_name_br.rb +1 -1
  241. data/test/test_name_cn.rb +1 -1
  242. data/test/test_name_cs.rb +1 -1
  243. data/test/test_name_da.rb +1 -1
  244. data/test/test_name_de.rb +1 -1
  245. data/test/test_name_es.rb +1 -1
  246. data/test/test_name_fr.rb +1 -1
  247. data/test/test_name_ga.rb +1 -1
  248. data/test/test_name_gr.rb +1 -1
  249. data/test/test_name_id.rb +1 -1
  250. data/test/test_name_it.rb +1 -1
  251. data/test/test_name_ja.rb +1 -1
  252. data/test/test_name_kh.rb +1 -1
  253. data/test/test_name_kr.rb +1 -1
  254. data/test/test_name_mx.rb +1 -1
  255. data/test/test_name_nb.rb +1 -1
  256. data/test/test_name_nl.rb +1 -1
  257. data/test/test_name_ph.rb +1 -1
  258. data/test/test_name_pl.rb +1 -1
  259. data/test/test_name_ru.rb +1 -1
  260. data/test/test_name_se.rb +1 -1
  261. data/test/test_name_sn.rb +1 -1
  262. data/test/test_name_th.rb +1 -1
  263. data/test/test_name_th_en.rb +1 -1
  264. data/test/test_name_tw.rb +1 -1
  265. data/test/test_name_ua.rb +1 -1
  266. data/test/test_name_vn.rb +1 -1
  267. data/test/test_nato_alphabet.rb +1 -1
  268. data/test/test_number.rb +45 -0
  269. data/test/test_phone_number.rb +1 -1
  270. data/test/test_phone_number_au.rb +1 -1
  271. data/test/test_phone_number_br.rb +1 -1
  272. data/test/test_phone_number_cu.rb +1 -1
  273. data/test/test_phone_number_da.rb +1 -1
  274. data/test/test_phone_number_de.rb +1 -1
  275. data/test/test_phone_number_fr.rb +1 -1
  276. data/test/test_phone_number_id.rb +1 -1
  277. data/test/test_phone_number_it.rb +12 -0
  278. data/test/test_phone_number_ja.rb +63 -0
  279. data/test/test_phone_number_kr.rb +1 -1
  280. data/test/test_phone_number_mx.rb +1 -1
  281. data/test/test_phone_number_nl.rb +1 -1
  282. data/test/test_phone_number_pl.rb +1 -1
  283. data/test/test_phone_number_se.rb +1 -1
  284. data/test/test_phone_number_sg.rb +1 -1
  285. data/test/test_phone_number_sn.rb +1 -1
  286. data/test/test_phone_number_tw.rb +1 -1
  287. data/test/test_phone_number_ua.rb +1 -1
  288. data/test/test_products.rb +1 -1
  289. data/test/test_sem_ver.rb +1 -1
  290. data/test/test_skill.rb +1 -1
  291. data/test/test_sport_pl.rb +1 -1
  292. data/test/test_sport_ru.rb +30 -0
  293. data/test/test_sport_us.rb +1 -1
  294. data/test/test_sports.rb +1 -1
  295. data/test/test_ssn.rb +1 -1
  296. data/test/test_ssn_mx.rb +1 -1
  297. data/test/test_ssn_se.rb +2 -2
  298. data/test/test_string.rb +4 -4
  299. data/test/test_time.rb +3 -4
  300. data/test/test_tweet.rb +5 -5
  301. data/test/test_unique_utils.rb +1 -1
  302. data/test/test_units.rb +2 -1
  303. data/test/test_units_english.rb +1 -1
  304. data/test/test_units_metric.rb +1 -1
  305. data/test/test_vehicle.rb +3 -3
  306. data/test/test_venue.rb +1 -1
  307. data/test/test_youtube.rb +1 -1
  308. metadata +232 -160
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestAddressNL < 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 TestFakerAddressPL < 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 TestAddressRU < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestAddressSE < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
- ALPHA = /\A[\p{Alpha}]+/.freeze
8
+ ALPHA = /\A\p{Alpha}+/.freeze
9
9
  DIGIT = /\d{1}/.freeze
10
10
 
11
11
  assert_methods_are_deterministic(
@@ -30,7 +30,7 @@ class TestAddressSE < Test::Unit::TestCase
30
30
  assert_match(ALPHA, address)
31
31
  assert_match(DIGIT, address)
32
32
  assert_match(/SVERIGE/, address)
33
- assert_match(/[\, a-z]/, address)
33
+ assert_match(/[, a-z]/, address)
34
34
  end
35
35
 
36
36
  def test_se_zip_code_frozen
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestAddressSn < 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 TestAddressUA < 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 TestAddressUK < 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 TestAddressUSUS < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_airline.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 TestAirline < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_animal.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 TestAnimals < 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 TestAnimalsCN < 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 TestAnimalsES < 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 TestAnimalsPL < 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 TestAnimalsUS < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
+ require 'set'
4
5
 
5
6
  class TestArrayUtils < Test::Unit::TestCase
6
7
  include DeterministicHelper
data/test/test_avatar.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 TestAvatar < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_aws.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 TestAWS < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -20,6 +20,6 @@ class TestAWS < Test::Unit::TestCase
20
20
  end
21
21
 
22
22
  def test_product_description
23
- assert_match(%r{\A[ \/a-zA-Z\(\)]+\z}i, FFaker::AWS.product_description)
23
+ assert_match(%r{\A[ /a-zA-Z()]+\z}i, FFaker::AWS.product_description)
24
24
  end
25
25
  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 TestBaconIpsum < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_bank.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 TestBank < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -33,7 +33,7 @@ class TestBank < Test::Unit::TestCase
33
33
  date_today = ::DateTime.now
34
34
 
35
35
  assert_random_between(
36
- date_today.strftime('%y'), date_today.next_year(5).strftime('%y')
36
+ date_today.strftime('%y')..date_today.next_year(5).strftime('%y')
37
37
  ) do
38
38
  @tester.card_expiry_date.split('/').pop
39
39
  end
@@ -41,8 +41,7 @@ class TestBank < Test::Unit::TestCase
41
41
  year_range = 4
42
42
  year_latest = 8
43
43
  assert_random_between(
44
- date_today.prev_year(year_latest + year_range).strftime('%y'),
45
- date_today.prev_year(year_latest).strftime('%y')
44
+ date_today.prev_year(year_latest + year_range).strftime('%y')..date_today.prev_year(year_latest).strftime('%y')
46
45
  ) do
47
46
  @tester.card_expiry_date(year_range: year_range, year_latest: year_latest).split('/').pop
48
47
  end
data/test/test_book.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 TestBook < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -19,7 +19,7 @@ class TestBook < Test::Unit::TestCase
19
19
  end
20
20
 
21
21
  def test_genre
22
- assert_match(%r{[\w\s'\/]+}, @tester.genre)
22
+ assert_match(%r{[\w\s'/]+}, @tester.genre)
23
23
  end
24
24
 
25
25
  def test_author
@@ -27,7 +27,7 @@ class TestBook < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_isbn
30
- assert_match(/[\d]+/, @tester.isbn)
30
+ assert_match(/\d+/, @tester.isbn)
31
31
  end
32
32
 
33
33
  def test_description
@@ -35,12 +35,12 @@ class TestBook < Test::Unit::TestCase
35
35
  end
36
36
 
37
37
  def test_cover
38
- assert_match(%r{\Ahttps:\/\/robohash\.org\/.+\.png\?size=300x300\z},
38
+ assert_match(%r{\Ahttps://robohash\.org/.+\.png\?size=300x300\z},
39
39
  @tester.cover)
40
40
  end
41
41
 
42
42
  def test_orly_cover
43
- assert_match(%r{\Ahttps:\/\/orly-appstore\.herokuapp\.com\/generate},
43
+ assert_match(%r{\Ahttps://orly-appstore\.herokuapp\.com/generate},
44
44
  @tester.orly_cover)
45
45
  end
46
46
  end
data/test/test_boolean.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 TestBoolean < 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 TestCheesyLingo < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_code.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 TestCode < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_color.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 TestColor < 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 TestColorPL < 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 TestColorUA < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_company.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 TestCompany < 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 TestCompanyCN < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestCompanyFR < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::CompanyFR,
10
+ :name, :suffix, :siren, :siret
11
+ )
12
+
13
+ def test_name
14
+ assert_match(/[ a-z]+/, FFaker::CompanyFR.name)
15
+ end
16
+
17
+ def test_suffix
18
+ assert_match(/[ a-z]+/i, FFaker::CompanyFR.suffix)
19
+ end
20
+
21
+ def test_french_siren_number
22
+ siren = FFaker::CompanyFR.siren
23
+ assert(siren.match(/\A\d{9}\z/))
24
+ assert(siren[8] == FFaker::CompanyFR.send(:luhn_check, siren[0..-2]).to_s)
25
+ end
26
+
27
+ def test_french_siret_number
28
+ siret = FFaker::CompanyFR.siret
29
+ assert(siret.match(/\A\d{14}\z/))
30
+ assert(siret[8] == FFaker::CompanyFR.send(:luhn_check, siret[0..7]).to_s)
31
+ assert(siret[13] == FFaker::CompanyFR.send(:luhn_check, siret[0..-2]).to_s)
32
+ end
33
+ 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 TestCompanyIT < 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 TestCompanyJA < 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 TestCompanySE < 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 TestConference < 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 TestCourseMathematiques < 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 TestCoursePhilosophie < 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 TestCurrency < 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 TestDizzleIpsum < 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 TestFakerEducation < 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 TestFakerEducationCN < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,10 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
- class TestFaker < Test::Unit::TestCase
5
+ class TestFFaker < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
+ def test_version
9
+ assert FFaker::VERSION.is_a?(String)
10
+ end
11
+
8
12
  def test_numerify
9
13
  assert FFaker.numerify('###').match(/\d{3}/)
10
14
  assert_deterministic { FFaker.numerify('###') }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerFilesystem < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -15,14 +15,22 @@ class TestFakerFilesystem < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  def test_extension
18
- assert @tester.extension.match(/(flac|mp3|wav|bmp|gif|jpeg|jpg|png|tiff|css|csv|html|js|json|txt|mp4|avi|mov|webm|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|pages|numbers|key|pdf)/)
18
+ assert_match /\A(?:flac|mp3|wav|bmp|gif|jpeg|jpg|png|tiff|css|csv|html|js|
19
+ json|txt|mp4|avi|mov|webm|doc|docx|xls|xlsx|ppt|pptx|odt|
20
+ ods|odp|pages|numbers|key|pdf)\z/x,
21
+ @tester.extension
19
22
  end
20
23
 
21
24
  def test_mime_type_format
22
- assert @tester.mime_type.match(%r{(.*)/(.*)+})
25
+ assert_match %r{\A\w+/.+\z}, @tester.mime_type
26
+ end
27
+
28
+ def test_directory
29
+ assert_match %r{\A(?:[a-z_-]+[\\/])+[a-z_-]+\z}, @tester.directory
23
30
  end
24
31
 
25
32
  def test_file_name
26
- assert @tester.file_name.match(%r{([a-z\-_]+)(\\|/)([a-z\-_]+)\.([a-z]+)})
33
+ assert_match %r{\A(?:[a-z_-]+[\\/])+[a-z_-]+\.\w{2,4}\z},
34
+ @tester.file_name
27
35
  end
28
36
  end
data/test/test_food.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 TestFakerFood < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerFoodPL < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::FoodPL,
10
+ :food, :processed, :unprocessed, :vegetable, :fruit,
11
+ :meat, :herb, :spice, :fermented, :diary, :preserves
12
+ )
13
+
14
+ def setup
15
+ @tester = FFaker::FoodPL
16
+ end
17
+
18
+ def test_food
19
+ assert_match(/\w+/, @tester.food)
20
+ end
21
+
22
+ def test_processed
23
+ assert_match(/\w+/, @tester.processed)
24
+ end
25
+
26
+ def test_unprocessed
27
+ assert_match(/\w+/, @tester.unprocessed)
28
+ end
29
+
30
+ def test_vegetable
31
+ assert_include(@tester::VEGETABLES, @tester.vegetable)
32
+ end
33
+
34
+ def test_fruit
35
+ assert_include(@tester::FRUITS, @tester.fruit)
36
+ end
37
+
38
+ def test_herb
39
+ assert_include(@tester::HERBS, @tester.herb)
40
+ end
41
+
42
+ def test_spice
43
+ assert_include(@tester::SPICES, @tester.spice)
44
+ end
45
+
46
+ def test_meat
47
+ assert_include(@tester::MEATS, @tester.meat)
48
+ end
49
+
50
+ def test_fermented
51
+ assert_include(@tester::FERMENTED, @tester.fermented)
52
+ end
53
+
54
+ def test_diary
55
+ assert_include(@tester::DIARY, @tester.diary)
56
+ end
57
+
58
+ def test_preserves
59
+ assert_include(@tester::PRESERVES, @tester.preserves)
60
+ end
61
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+ class TestFreedomIpsum < Test::Unit::TestCase
5
+ include DeterministicHelper
6
+
7
+ assert_methods_are_deterministic(
8
+ FFaker::FreedomIpsum,
9
+ :word, :words
10
+ )
11
+
12
+ TEST_REGEX = /[a-z0-9 -]+/i.freeze
13
+
14
+ def test_words
15
+ assert_match(TEST_REGEX, FFaker::FreedomIpsum.words.join(' '))
16
+ end
17
+
18
+ def test_word
19
+ assert_match(TEST_REGEX, FFaker::FreedomIpsum.word)
20
+ end
21
+ end
data/test/test_game.rb ADDED
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestGame < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::Game,
10
+ :title, :category, :mechanic
11
+ )
12
+
13
+ def setup
14
+ @tester = FFaker::Game
15
+ end
16
+
17
+ def test_title
18
+ assert_match(/[\sa-z]+/, @tester.title)
19
+ end
20
+
21
+ def test_category
22
+ assert_match(%r{[\w\s'/]+}, @tester.category)
23
+ end
24
+
25
+ def test_mechanic
26
+ assert_match(/[\sa-z]+/, @tester.mechanic)
27
+ end
28
+ end
data/test/test_gender.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerGender < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
- assert_methods_are_deterministic(FFaker::Gender, :random)
8
+ assert_methods_are_deterministic(FFaker::Gender, :binary, :random)
9
9
 
10
10
  def setup
11
11
  @tester = FFaker::Gender
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerGenderBR < 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 TestFakerGenderCN < Test::Unit::TestCase
6
6
  include DeterministicHelper