ffaker 2.10.0 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (644) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +217 -15
  3. data/Gemfile +17 -0
  4. data/README.md +43 -10
  5. data/REFERENCE.md +1681 -1241
  6. data/Rakefile +20 -55
  7. data/bin/console +9 -0
  8. data/ffaker.gemspec +17 -23
  9. data/lib/ffaker/address.rb +7 -7
  10. data/lib/ffaker/address_au.rb +8 -10
  11. data/lib/ffaker/address_br.rb +16 -4
  12. data/lib/ffaker/address_ca.rb +3 -3
  13. data/lib/ffaker/address_ch.rb +1 -3
  14. data/lib/ffaker/address_ch_de.rb +1 -3
  15. data/lib/ffaker/address_ch_fr.rb +1 -3
  16. data/lib/ffaker/address_ch_it.rb +1 -3
  17. data/lib/ffaker/address_da.rb +1 -3
  18. data/lib/ffaker/address_de.rb +1 -3
  19. data/lib/ffaker/address_fi.rb +1 -3
  20. data/lib/ffaker/address_fr.rb +9 -9
  21. data/lib/ffaker/address_gr.rb +1 -3
  22. data/lib/ffaker/address_id.rb +0 -3
  23. data/lib/ffaker/address_in.rb +5 -3
  24. data/lib/ffaker/address_it.rb +33 -0
  25. data/lib/ffaker/address_ja.rb +0 -3
  26. data/lib/ffaker/address_kr.rb +0 -1
  27. data/lib/ffaker/address_mx.rb +3 -471
  28. data/lib/ffaker/address_nl.rb +2 -6
  29. data/lib/ffaker/address_pl.rb +0 -2
  30. data/lib/ffaker/address_ru.rb +1 -3
  31. data/lib/ffaker/address_se.rb +1 -3
  32. data/lib/ffaker/address_sn.rb +1 -4
  33. data/lib/ffaker/address_ua.rb +3 -5
  34. data/lib/ffaker/address_uk.rb +1 -3
  35. data/lib/ffaker/address_us.rb +23 -5
  36. data/lib/ffaker/airline.rb +1 -1
  37. data/lib/ffaker/animal.rb +14 -0
  38. data/lib/ffaker/{animals.rb → animal_br.rb} +2 -2
  39. data/lib/ffaker/animal_cn.rb +12 -0
  40. data/lib/ffaker/animal_es.rb +12 -0
  41. data/lib/ffaker/animal_pl.rb +15 -0
  42. data/lib/ffaker/animal_us.rb +12 -0
  43. data/lib/ffaker/avatar.rb +32 -6
  44. data/lib/ffaker/aws.rb +1 -1
  45. data/lib/ffaker/bacon_ipsum.rb +1 -3
  46. data/lib/ffaker/bank.rb +118 -0
  47. data/lib/ffaker/bank_us.rb +33 -0
  48. data/lib/ffaker/book.rb +16 -8
  49. data/lib/ffaker/boolean.rb +1 -1
  50. data/lib/ffaker/cheesy_lingo.rb +5 -8
  51. data/lib/ffaker/code.rb +17 -1
  52. data/lib/ffaker/color.rb +7 -7
  53. data/lib/ffaker/color_pl.rb +14 -0
  54. data/lib/ffaker/color_ua.rb +1 -1
  55. data/lib/ffaker/company.rb +6 -9
  56. data/lib/ffaker/company_cn.rb +1 -1
  57. data/lib/ffaker/company_fr.rb +35 -0
  58. data/lib/ffaker/company_it.rb +4 -2
  59. data/lib/ffaker/company_ja.rb +24 -0
  60. data/lib/ffaker/company_se.rb +1 -1
  61. data/lib/ffaker/conference.rb +1 -1
  62. data/lib/ffaker/{courses.rb → courses_fr.rb} +3 -1
  63. data/lib/ffaker/crypto.rb +14 -0
  64. data/lib/ffaker/currency.rb +1 -1
  65. data/lib/ffaker/data/address/city_suffixes +1 -1
  66. data/lib/ffaker/data/address/country +1 -1
  67. data/lib/ffaker/data/address/country_code +1 -1
  68. data/lib/ffaker/data/address/neighborhood +1 -1
  69. data/lib/ffaker/data/address/street_suffix +1 -1
  70. data/lib/ffaker/data/address_br/city +0 -1
  71. data/lib/ffaker/data/address_br/complement +3 -0
  72. data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
  73. data/lib/ffaker/data/address_br/state +1 -1
  74. data/lib/ffaker/data/address_ca/city +99 -99
  75. data/lib/ffaker/data/address_ca/province +1 -1
  76. data/lib/ffaker/data/address_de/city +1 -1
  77. data/lib/ffaker/data/address_de/state +2 -1
  78. data/lib/ffaker/data/address_fr/city +1 -1
  79. data/lib/ffaker/data/address_fr/region +27 -0
  80. data/lib/ffaker/data/address_gr/city +1 -1
  81. data/lib/ffaker/data/address_gr/region +1 -1
  82. data/lib/ffaker/data/address_gr/street +1 -1
  83. data/lib/ffaker/data/address_in/city +24 -0
  84. data/lib/ffaker/data/address_it/city +111 -0
  85. data/lib/ffaker/data/address_it/region +20 -0
  86. data/lib/ffaker/data/address_ja/city +0 -23
  87. data/lib/ffaker/data/address_mx/ags +11 -0
  88. data/lib/ffaker/data/address_mx/bc +5 -0
  89. data/lib/ffaker/data/address_mx/bcs +5 -0
  90. data/lib/ffaker/data/address_mx/camp +11 -0
  91. data/lib/ffaker/data/address_mx/chih +67 -0
  92. data/lib/ffaker/data/address_mx/chis +118 -0
  93. data/lib/ffaker/data/address_mx/coah +38 -0
  94. data/lib/ffaker/data/address_mx/col +10 -0
  95. data/lib/ffaker/data/address_mx/df +16 -0
  96. data/lib/ffaker/data/address_mx/dgo +39 -0
  97. data/lib/ffaker/data/address_mx/gro +81 -0
  98. data/lib/ffaker/data/address_mx/gto +46 -0
  99. data/lib/ffaker/data/address_mx/hgo +84 -0
  100. data/lib/ffaker/data/address_mx/jal +125 -0
  101. data/lib/ffaker/data/address_mx/mex +125 -0
  102. data/lib/ffaker/data/address_mx/mich +113 -0
  103. data/lib/ffaker/data/address_mx/mor +33 -0
  104. data/lib/ffaker/data/address_mx/nay +20 -0
  105. data/lib/ffaker/data/address_mx/nl +51 -0
  106. data/lib/ffaker/data/address_mx/oax +570 -0
  107. data/lib/ffaker/data/address_mx/pue +217 -0
  108. data/lib/ffaker/data/address_mx/qr +10 -0
  109. data/lib/ffaker/data/address_mx/qro +18 -0
  110. data/lib/ffaker/data/address_mx/sin +18 -0
  111. data/lib/ffaker/data/address_mx/slp +58 -0
  112. data/lib/ffaker/data/address_mx/son +72 -0
  113. data/lib/ffaker/data/address_mx/state +1 -1
  114. data/lib/ffaker/data/address_mx/state_abbr +1 -1
  115. data/lib/ffaker/data/address_mx/tab +17 -0
  116. data/lib/ffaker/data/address_mx/tamps +43 -0
  117. data/lib/ffaker/data/address_mx/tlax +60 -0
  118. data/lib/ffaker/data/address_mx/ver +212 -0
  119. data/lib/ffaker/data/address_mx/yuc +106 -0
  120. data/lib/ffaker/data/address_mx/zac +58 -0
  121. data/lib/ffaker/data/address_ru/city +1 -1
  122. data/lib/ffaker/data/address_se/city +1 -1
  123. data/lib/ffaker/data/address_se/countries +1 -1
  124. data/lib/ffaker/data/address_se/street +1 -1
  125. data/lib/ffaker/data/address_sn/arrondissements +1 -1
  126. data/lib/ffaker/data/address_sn/departements +1 -1
  127. data/lib/ffaker/data/address_sn/regions +1 -1
  128. data/lib/ffaker/data/address_uk/county +1 -1
  129. data/lib/ffaker/data/address_us/state +1 -1
  130. data/lib/ffaker/data/address_us/state_abbr +1 -2
  131. data/lib/ffaker/data/address_us/state_and_territories_abbr +1 -1
  132. data/lib/ffaker/data/animal_br/common_names +423 -0
  133. data/lib/ffaker/data/animal_cn/common_names +141 -0
  134. data/lib/ffaker/data/animal_es/common_names +135 -0
  135. data/lib/ffaker/data/animal_pl/common_names +256 -0
  136. data/lib/ffaker/data/animal_us/common_names +141 -0
  137. data/lib/ffaker/data/aws/ec2_reserved_instance_tenancy +1 -1
  138. data/lib/ffaker/data/aws/ec2_reserved_offering_type +1 -1
  139. data/lib/ffaker/data/aws/ec2_reserved_product_description +1 -1
  140. data/lib/ffaker/data/bank/card_types +12 -0
  141. data/lib/ffaker/data/book/nouns +2 -2
  142. data/lib/ffaker/data/cheesy_lingo/cheesy_phrases +1 -1
  143. data/lib/ffaker/data/cheesy_lingo/cheesy_words +1 -1
  144. data/lib/ffaker/data/color/names_list +1 -1
  145. data/lib/ffaker/data/color_pl/names_list +122 -0
  146. data/lib/ffaker/data/company/bs_mid +1 -1
  147. data/lib/ffaker/data/company/bs_pos +1 -1
  148. data/lib/ffaker/data/company/bs_pre +1 -1
  149. data/lib/ffaker/data/company/catch_mid +1 -1
  150. data/lib/ffaker/data/company/catch_pos +1 -1
  151. data/lib/ffaker/data/company/catch_pre +1 -1
  152. data/lib/ffaker/data/company/position_areas +1 -1
  153. data/lib/ffaker/data/conference/conference_list +1 -1
  154. data/lib/ffaker/data/currency/currency_code +1 -1
  155. data/lib/ffaker/data/currency/currency_name +1 -1
  156. data/lib/ffaker/data/currency/currency_symbol +0 -1
  157. data/lib/ffaker/data/dizzle_ipsum/dizzle_words +1 -1
  158. data/lib/ffaker/data/education/major_noun +1 -1
  159. data/lib/ffaker/data/education/school_suffix +1 -1
  160. data/lib/ffaker/data/education_cn/city +351 -0
  161. data/lib/ffaker/data/education_cn/major +506 -0
  162. data/lib/ffaker/data/education_cn/province +31 -0
  163. data/lib/ffaker/data/education_cn/school_type +27 -0
  164. data/lib/ffaker/data/filesystem/extension +31 -31
  165. data/lib/ffaker/data/food/fruit +1 -1
  166. data/lib/ffaker/data/food/herb_spice +1 -1
  167. data/lib/ffaker/data/food/meat +1 -1
  168. data/lib/ffaker/data/food/vegetable +1 -1
  169. data/lib/ffaker/data/food_pl/diary +14 -0
  170. data/lib/ffaker/data/food_pl/fermented +13 -0
  171. data/lib/ffaker/data/food_pl/fruits +34 -0
  172. data/lib/ffaker/data/food_pl/herbs +20 -0
  173. data/lib/ffaker/data/food_pl/meats +9 -0
  174. data/lib/ffaker/data/food_pl/preserves +10 -0
  175. data/lib/ffaker/data/food_pl/spices +26 -0
  176. data/lib/ffaker/data/food_pl/vegetables +45 -0
  177. data/lib/ffaker/data/freedom_ipsum/freedom_words +161 -0
  178. data/lib/ffaker/data/game/adj_and_adv +18 -0
  179. data/lib/ffaker/data/game/category +84 -0
  180. data/lib/ffaker/data/game/mechanic +182 -0
  181. data/lib/ffaker/data/game/nouns +37 -0
  182. data/lib/ffaker/data/game/prefixes +17 -0
  183. data/lib/ffaker/data/healthcare_ru/doctor_specialization +127 -0
  184. data/lib/ffaker/data/hipster_ipsum/hipster_words +1 -1
  185. data/lib/ffaker/data/identification_mx/estados_curp +1 -1
  186. data/lib/ffaker/data/jo_jo/first_names +356 -0
  187. data/lib/ffaker/data/jo_jo/full_names +225 -0
  188. data/lib/ffaker/data/jo_jo/last_names +153 -0
  189. data/lib/ffaker/data/jo_jo/stands +149 -0
  190. data/lib/ffaker/data/job/job_adj +1 -1
  191. data/lib/ffaker/data/job/job_noun +1 -1
  192. data/lib/ffaker/data/job/job_prefix +1 -1
  193. data/lib/ffaker/data/job_fr/job_prefixes +1 -1
  194. data/lib/ffaker/data/job_it/job_adj +37 -0
  195. data/lib/ffaker/data/job_it/job_noun +25 -0
  196. data/lib/ffaker/data/job_it/job_prefix +22 -0
  197. data/lib/ffaker/data/locale/language +1 -1
  198. data/lib/ffaker/data/locale/language_code +1 -1
  199. data/lib/ffaker/data/lorem/characters +1 -1
  200. data/lib/ffaker/data/lorem/words +1 -68
  201. data/lib/ffaker/data/lorem_ar/words +1 -1
  202. data/lib/ffaker/data/lorem_br/characters +36 -0
  203. data/lib/ffaker/data/lorem_br/words +183 -0
  204. data/lib/ffaker/data/lorem_cn/words +1 -1
  205. data/lib/ffaker/data/lorem_fr/words +1 -1
  206. data/lib/ffaker/data/lorem_it/words +321 -0
  207. data/lib/ffaker/data/movie/adj_and_adv +1 -1
  208. data/lib/ffaker/data/movie/nouns +3 -3
  209. data/lib/ffaker/data/movie/prefixes +1 -1
  210. data/lib/ffaker/data/name/first_names_female +0 -230
  211. data/lib/ffaker/data/name/first_names_male +0 -37
  212. data/lib/ffaker/data/name/last_names +1 -2
  213. data/lib/ffaker/data/name/pronouns +6 -0
  214. data/lib/ffaker/data/name_ar/first_names_female +1 -1
  215. data/lib/ffaker/data/name_ar/first_names_male +1 -1
  216. data/lib/ffaker/data/name_ar/last_names +1 -1
  217. data/lib/ffaker/data/name_cn/first_names +1 -1
  218. data/lib/ffaker/data/name_cn/last_names +1 -1
  219. data/lib/ffaker/data/name_cs/female_first_names +40 -0
  220. data/lib/ffaker/data/name_cs/female_last_names +50 -0
  221. data/lib/ffaker/data/name_cs/male_first_names +88 -0
  222. data/lib/ffaker/data/name_cs/male_last_names +49 -0
  223. data/lib/ffaker/data/name_cs/prefixes +4 -4
  224. data/lib/ffaker/data/name_de/first_names +1 -1
  225. data/lib/ffaker/data/name_de/last_names +1 -1
  226. data/lib/ffaker/data/name_fr/first_names +1 -1
  227. data/lib/ffaker/data/name_fr/last_names +1 -1
  228. data/lib/ffaker/data/name_ga/first_names_female +1 -1
  229. data/lib/ffaker/data/name_ga/first_names_male +287 -287
  230. data/lib/ffaker/data/name_gr/female_first_names +1 -1
  231. data/lib/ffaker/data/name_gr/female_last_names +1 -1
  232. data/lib/ffaker/data/name_gr/male_first_names +1 -1
  233. data/lib/ffaker/data/name_gr/male_last_names +1 -1
  234. data/lib/ffaker/data/name_in/first_names_female +100 -0
  235. data/lib/ffaker/data/name_in/first_names_male +100 -0
  236. data/lib/ffaker/data/name_in/last_names +100 -0
  237. data/lib/ffaker/data/name_it/first_names +1 -1
  238. data/lib/ffaker/data/name_it/last_names +1 -1
  239. data/lib/ffaker/data/name_ja/first_names +1 -1
  240. data/lib/ffaker/data/name_ja/last_names +1 -1
  241. data/lib/ffaker/data/name_kh/first_names +1 -1
  242. data/lib/ffaker/data/name_kh/nick_names +1 -1
  243. data/lib/ffaker/data/name_kr/first_names +1 -1
  244. data/lib/ffaker/data/name_kr/last_names +1 -1
  245. data/lib/ffaker/data/name_mx/female_first_names +1 -1
  246. data/lib/ffaker/data/name_mx/last_names +1 -1
  247. data/lib/ffaker/data/name_mx/male_first_names +1 -1
  248. data/lib/ffaker/data/name_ph/autochthonous_surnames +1 -1
  249. data/lib/ffaker/data/name_ph/spanish_surnames +1 -1
  250. data/lib/ffaker/data/name_ru/first_names_female +91 -0
  251. data/lib/ffaker/data/name_ru/first_names_male +172 -0
  252. data/lib/ffaker/data/name_ru/last_names_female +100 -0
  253. data/lib/ffaker/data/name_ru/last_names_male +100 -0
  254. data/lib/ffaker/data/name_ru/middle_names_female +65 -0
  255. data/lib/ffaker/data/name_ru/middle_names_male +73 -0
  256. data/lib/ffaker/data/name_se/first_names_female +1 -1
  257. data/lib/ffaker/data/name_se/first_names_male +1 -1
  258. data/lib/ffaker/data/name_se/last_names +1 -1
  259. data/lib/ffaker/data/name_sn/first_names_female +1 -1
  260. data/lib/ffaker/data/name_sn/first_names_male +1 -1
  261. data/lib/ffaker/data/name_sn/last_names +1 -1
  262. data/lib/ffaker/data/name_th/first_names +1 -1
  263. data/lib/ffaker/data/name_th/last_names +1 -1
  264. data/lib/ffaker/data/name_th/nick_names +1 -1
  265. data/lib/ffaker/data/name_tw/first_names +122 -0
  266. data/lib/ffaker/data/name_tw/last_names +100 -0
  267. data/lib/ffaker/data/nato_alphabet/alphabet_codes +26 -0
  268. data/lib/ffaker/data/nato_alphabet/numeric_codes +10 -0
  269. data/lib/ffaker/data/phone_number_ja/four_disit_area_codes +41 -0
  270. data/lib/ffaker/data/phone_number_ja/one_disit_area_codes +3 -0
  271. data/lib/ffaker/data/phone_number_ja/three_disit_area_codes +296 -0
  272. data/lib/ffaker/data/phone_number_ja/two_disit_area_codes +48 -0
  273. data/lib/ffaker/data/phone_number_nl/area_codes +142 -0
  274. data/lib/ffaker/data/phone_number_ru/home_phone_prefixes +107 -0
  275. data/lib/ffaker/data/phone_number_ru/mobile_phone_prefixes +61 -0
  276. data/lib/ffaker/data/phone_number_se/phone_prefix +1 -1
  277. data/lib/ffaker/data/phone_number_ua/home_phone_prefixes +29 -0
  278. data/lib/ffaker/data/phone_number_ua/mobile_phone_prefixes +11 -0
  279. data/lib/ffaker/data/product/adj +1 -1
  280. data/lib/ffaker/data/product/b1 +1 -1
  281. data/lib/ffaker/data/product/noun +4 -1
  282. data/lib/ffaker/data/skill/specialty_end +1 -1
  283. data/lib/ffaker/data/skill/specialty_start +1 -1
  284. data/lib/ffaker/data/skill/tech_skills +1 -1
  285. data/lib/ffaker/data/sport_pl/summer +53 -0
  286. data/lib/ffaker/data/sport_pl/winter +14 -0
  287. data/lib/ffaker/data/sport_ru/summer +68 -0
  288. data/lib/ffaker/data/sport_ru/winter +20 -0
  289. data/lib/ffaker/data/sport_us/names +67 -0
  290. data/lib/ffaker/data/vehicle/color_prefixes +25 -0
  291. data/lib/ffaker/data/vehicle/displacements_list +1 -1
  292. data/lib/ffaker/data/vehicle/fuel_types_list +1 -1
  293. data/lib/ffaker/data/vehicle/makes_list +1 -1
  294. data/lib/ffaker/data/vehicle/transmissions_list +1 -1
  295. data/lib/ffaker/data/vehicle/upholstery_list +1 -1
  296. data/lib/ffaker/data/venue/venue_list +1 -1
  297. data/lib/ffaker/date.rb +40 -0
  298. data/lib/ffaker/dizzle_ipsum.rb +1 -3
  299. data/lib/ffaker/education.rb +9 -10
  300. data/lib/ffaker/education_cn.rb +37 -0
  301. data/lib/ffaker/filesystem.rb +18 -8
  302. data/lib/ffaker/food.rb +2 -0
  303. data/lib/ffaker/food_pl.rb +65 -0
  304. data/lib/ffaker/freedom_ipsum.rb +20 -0
  305. data/lib/ffaker/game.rb +33 -0
  306. data/lib/ffaker/gender.rb +1 -1
  307. data/lib/ffaker/gender_br.rb +1 -1
  308. data/lib/ffaker/gender_cn.rb +1 -1
  309. data/lib/ffaker/gender_id.rb +0 -1
  310. data/lib/ffaker/gender_it.rb +17 -0
  311. data/lib/ffaker/gender_ja.rb +18 -0
  312. data/lib/ffaker/gender_jp.rb +11 -0
  313. data/lib/ffaker/gender_kr.rb +1 -1
  314. data/lib/ffaker/gender_pl.rb +19 -0
  315. data/lib/ffaker/gender_ru.rb +22 -0
  316. data/lib/ffaker/geolocation.rb +34 -24
  317. data/lib/ffaker/guid.rb +1 -1
  318. data/lib/ffaker/healthcare_ipsum.rb +1 -3
  319. data/lib/ffaker/healthcare_ru.rb +12 -0
  320. data/lib/ffaker/hipster_ipsum.rb +1 -3
  321. data/lib/ffaker/html_ipsum.rb +10 -4
  322. data/lib/ffaker/identification.rb +5 -2
  323. data/lib/ffaker/identification_br.rb +4 -13
  324. data/lib/ffaker/identification_ec.rb +39 -0
  325. data/lib/ffaker/identification_es.rb +1 -1
  326. data/lib/ffaker/identification_es_cl.rb +7 -6
  327. data/lib/ffaker/identification_es_co.rb +3 -4
  328. data/lib/ffaker/identification_in.rb +15 -0
  329. data/lib/ffaker/identification_it.rb +30 -0
  330. data/lib/ffaker/identification_kr.rb +13 -6
  331. data/lib/ffaker/identification_mx.rb +14 -20
  332. data/lib/ffaker/identification_pl.rb +77 -0
  333. data/lib/ffaker/identification_tw.rb +24 -0
  334. data/lib/ffaker/image.rb +37 -14
  335. data/lib/ffaker/internet.rb +18 -25
  336. data/lib/ffaker/internet_se.rb +8 -10
  337. data/lib/ffaker/jo_jo.rb +24 -0
  338. data/lib/ffaker/job.rb +1 -1
  339. data/lib/ffaker/job_br.rb +1 -1
  340. data/lib/ffaker/job_cn.rb +1 -1
  341. data/lib/ffaker/job_fr.rb +1 -1
  342. data/lib/ffaker/job_it.rb +12 -0
  343. data/lib/ffaker/job_ja.rb +0 -1
  344. data/lib/ffaker/job_kr.rb +1 -1
  345. data/lib/ffaker/job_vn.rb +0 -1
  346. data/lib/ffaker/locale.rb +8 -12
  347. data/lib/ffaker/lorem.rb +6 -7
  348. data/lib/ffaker/lorem_ar.rb +1 -1
  349. data/lib/ffaker/lorem_br.rb +45 -0
  350. data/lib/ffaker/lorem_cn.rb +1 -2
  351. data/lib/ffaker/lorem_fr.rb +1 -1
  352. data/lib/ffaker/lorem_ie.rb +0 -1
  353. data/lib/ffaker/lorem_it.rb +39 -0
  354. data/lib/ffaker/lorem_ja.rb +2 -2
  355. data/lib/ffaker/lorem_kr.rb +1 -1
  356. data/lib/ffaker/lorem_pl.rb +0 -2
  357. data/lib/ffaker/lorem_ru.rb +1 -2
  358. data/lib/ffaker/lorem_ua.rb +3 -5
  359. data/lib/ffaker/movie.rb +8 -5
  360. data/lib/ffaker/music.rb +1 -1
  361. data/lib/ffaker/name.rb +5 -1
  362. data/lib/ffaker/name_ar.rb +0 -1
  363. data/lib/ffaker/name_br.rb +1 -1
  364. data/lib/ffaker/name_cn.rb +1 -1
  365. data/lib/ffaker/name_cs.rb +7 -9
  366. data/lib/ffaker/name_da.rb +2 -4
  367. data/lib/ffaker/name_de.rb +1 -3
  368. data/lib/ffaker/name_es.rb +0 -2
  369. data/lib/ffaker/name_fr.rb +5 -5
  370. data/lib/ffaker/name_ga.rb +1 -1
  371. data/lib/ffaker/name_gr.rb +2 -3
  372. data/lib/ffaker/name_id.rb +0 -1
  373. data/lib/ffaker/name_in.rb +39 -0
  374. data/lib/ffaker/name_it.rb +2 -3
  375. data/lib/ffaker/name_ja.rb +1 -1
  376. data/lib/ffaker/name_kh.rb +2 -0
  377. data/lib/ffaker/name_kr.rb +1 -1
  378. data/lib/ffaker/name_mx.rb +4 -6
  379. data/lib/ffaker/name_nb.rb +1 -3
  380. data/lib/ffaker/name_nl.rb +1 -3
  381. data/lib/ffaker/name_ph.rb +1 -3
  382. data/lib/ffaker/name_pl.rb +2 -3
  383. data/lib/ffaker/name_ru.rb +32 -71
  384. data/lib/ffaker/name_se.rb +1 -3
  385. data/lib/ffaker/name_sn.rb +3 -6
  386. data/lib/ffaker/name_th.rb +1 -1
  387. data/lib/ffaker/name_th_en.rb +2 -2
  388. data/lib/ffaker/name_tw.rb +20 -0
  389. data/lib/ffaker/name_ua.rb +1 -3
  390. data/lib/ffaker/name_vn.rb +1 -1
  391. data/lib/ffaker/nato_alphabet.rb +2 -4
  392. data/lib/ffaker/number.rb +30 -0
  393. data/lib/ffaker/phone_number.rb +1 -1
  394. data/lib/ffaker/phone_number_au.rb +11 -12
  395. data/lib/ffaker/phone_number_br.rb +16 -14
  396. data/lib/ffaker/phone_number_ch.rb +1 -1
  397. data/lib/ffaker/phone_number_cu.rb +18 -27
  398. data/lib/ffaker/phone_number_da.rb +1 -3
  399. data/lib/ffaker/phone_number_de.rb +4 -5
  400. data/lib/ffaker/phone_number_fr.rb +3 -12
  401. data/lib/ffaker/phone_number_id.rb +2 -6
  402. data/lib/ffaker/phone_number_it.rb +9 -7
  403. data/lib/ffaker/phone_number_ja.rb +88 -0
  404. data/lib/ffaker/phone_number_kr.rb +1 -1
  405. data/lib/ffaker/phone_number_mx.rb +1 -2
  406. data/lib/ffaker/phone_number_nl.rb +9 -12
  407. data/lib/ffaker/phone_number_pl.rb +68 -0
  408. data/lib/ffaker/phone_number_ru.rb +120 -0
  409. data/lib/ffaker/phone_number_se.rb +1 -1
  410. data/lib/ffaker/phone_number_sg.rb +1 -1
  411. data/lib/ffaker/phone_number_sn.rb +12 -19
  412. data/lib/ffaker/phone_number_tw.rb +49 -0
  413. data/lib/ffaker/phone_number_ua.rb +42 -0
  414. data/lib/ffaker/product.rb +10 -12
  415. data/lib/ffaker/sem_ver.rb +19 -0
  416. data/lib/ffaker/skill.rb +2 -2
  417. data/lib/ffaker/sport.rb +4 -0
  418. data/lib/ffaker/sport_pl.rb +25 -0
  419. data/lib/ffaker/sport_ru.rb +25 -0
  420. data/lib/ffaker/sport_us.rb +12 -0
  421. data/lib/ffaker/ssn.rb +5 -5
  422. data/lib/ffaker/ssn_mx.rb +1 -2
  423. data/lib/ffaker/ssn_se.rb +16 -44
  424. data/lib/ffaker/string.rb +18 -17
  425. data/lib/ffaker/time.rb +12 -11
  426. data/lib/ffaker/tweet.rb +4 -4
  427. data/lib/ffaker/unit.rb +10 -11
  428. data/lib/ffaker/unit_english.rb +19 -22
  429. data/lib/ffaker/unit_metric.rb +16 -19
  430. data/lib/ffaker/utils/array_utils.rb +8 -5
  431. data/lib/ffaker/utils/module_utils.rb +27 -6
  432. data/lib/ffaker/utils/random_utils.rb +4 -0
  433. data/lib/ffaker/utils/unique_utils.rb +32 -21
  434. data/lib/ffaker/vehicle.rb +67 -9
  435. data/lib/ffaker/venue.rb +1 -1
  436. data/lib/ffaker/version.rb +5 -0
  437. data/lib/ffaker/youtube.rb +1 -1
  438. data/lib/ffaker.rb +74 -164
  439. data/scripts/benchmark.rb +12 -11
  440. data/scripts/profiling.rb +3 -1
  441. data/scripts/reference.rb +26 -24
  442. data/test/helper.rb +41 -6
  443. data/test/test_address.rb +2 -2
  444. data/test/test_address_au.rb +7 -8
  445. data/test/test_address_br.rb +17 -4
  446. data/test/test_address_ca.rb +2 -2
  447. data/test/test_address_ch.rb +2 -2
  448. data/test/test_address_ch_de.rb +2 -2
  449. data/test/test_address_ch_fr.rb +2 -2
  450. data/test/test_address_ch_it.rb +2 -2
  451. data/test/test_address_da.rb +5 -5
  452. data/test/test_address_de.rb +2 -2
  453. data/test/test_address_fi.rb +4 -5
  454. data/test/test_address_fr.rb +3 -4
  455. data/test/test_address_gr.rb +2 -2
  456. data/test/test_address_id.rb +2 -3
  457. data/test/test_address_in.rb +2 -2
  458. data/test/test_address_it.rb +12 -0
  459. data/test/test_address_ja.rb +2 -3
  460. data/test/test_address_kr.rb +1 -2
  461. data/test/test_address_mx.rb +2 -3
  462. data/test/test_address_nl.rb +3 -3
  463. data/test/test_address_pl.rb +1 -2
  464. data/test/test_address_ru.rb +2 -2
  465. data/test/test_address_se.rb +4 -4
  466. data/test/test_address_sn.rb +2 -5
  467. data/test/test_address_ua.rb +2 -2
  468. data/test/test_address_uk.rb +2 -2
  469. data/test/test_address_us.rb +11 -2
  470. data/test/test_airline.rb +2 -2
  471. data/test/test_animal.rb +2 -2
  472. data/test/test_animal_br.rb +17 -0
  473. data/test/test_animal_cn.rb +17 -0
  474. data/test/test_animal_es.rb +17 -0
  475. data/test/test_animal_pl.rb +17 -0
  476. data/test/test_animal_us.rb +17 -0
  477. data/test/test_array_utils.rb +3 -3
  478. data/test/test_avatar.rb +35 -10
  479. data/test/test_aws.rb +3 -3
  480. data/test/test_bacon_ipsum.rb +2 -2
  481. data/test/test_bank.rb +53 -0
  482. data/test/test_bank_us.rb +35 -0
  483. data/test/test_book.rb +35 -6
  484. data/test/test_boolean.rb +3 -3
  485. data/test/test_cheesy_lingo.rb +4 -2
  486. data/test/test_code.rb +23 -3
  487. data/test/test_color.rb +2 -2
  488. data/test/test_color_pl.rb +13 -0
  489. data/test/test_color_ua.rb +2 -2
  490. data/test/test_company.rb +4 -4
  491. data/test/test_company_cn.rb +2 -2
  492. data/test/test_company_fr.rb +33 -0
  493. data/test/test_company_it.rb +2 -2
  494. data/test/test_company_ja.rb +28 -0
  495. data/test/test_company_se.rb +2 -2
  496. data/test/test_conference.rb +2 -2
  497. data/test/test_course_mathematiques.rb +3 -1
  498. data/test/test_course_philosophie.rb +3 -1
  499. data/test/test_crypto.rb +15 -0
  500. data/test/test_currency.rb +2 -2
  501. data/test/test_date.rb +47 -0
  502. data/test/test_dizzle_ipsum.rb +2 -2
  503. data/test/test_education.rb +2 -2
  504. data/test/test_education_cn.rb +29 -0
  505. data/test/{test_faker.rb → test_ffaker.rb} +7 -3
  506. data/test/test_filesystem.rb +39 -5
  507. data/test/test_food.rb +3 -3
  508. data/test/test_food_pl.rb +61 -0
  509. data/test/test_freedom_ipsum.rb +21 -0
  510. data/test/test_game.rb +28 -0
  511. data/test/test_gender.rb +3 -3
  512. data/test/test_gender_br.rb +2 -2
  513. data/test/test_gender_cn.rb +2 -2
  514. data/test/test_gender_id.rb +1 -2
  515. data/test/test_gender_it.rb +27 -0
  516. data/test/test_gender_ja.rb +27 -0
  517. data/test/test_gender_jp.rb +27 -0
  518. data/test/test_gender_kr.rb +2 -2
  519. data/test/test_gender_pl.rb +27 -0
  520. data/test/test_gender_ru.rb +23 -0
  521. data/test/test_geolocation.rb +4 -4
  522. data/test/test_guid.rb +2 -2
  523. data/test/test_healthcare_ipsum.rb +3 -1
  524. data/test/test_healthcare_ru.rb +19 -0
  525. data/test/test_hipster_ipsum.rb +2 -2
  526. data/test/test_html_ipsum.rb +20 -14
  527. data/test/test_identification.rb +14 -4
  528. data/test/test_identification_br.rb +2 -2
  529. data/test/test_identification_co.rb +5 -3
  530. data/test/test_identification_ec.rb +33 -0
  531. data/test/test_identification_es.rb +2 -2
  532. data/test/test_identification_es_cl.rb +3 -3
  533. data/test/test_identification_es_mx.rb +5 -4
  534. data/test/test_identification_in.rb +20 -0
  535. data/test/test_identification_it.rb +45 -0
  536. data/test/test_identification_kr.rb +5 -5
  537. data/test/test_identification_pl.rb +28 -0
  538. data/test/test_identification_tw.rb +17 -0
  539. data/test/test_image.rb +56 -10
  540. data/test/test_internet.rb +18 -16
  541. data/test/test_internet_se.rb +12 -9
  542. data/test/test_jo_jo.rb +29 -0
  543. data/test/test_job.rb +2 -2
  544. data/test/test_job_br.rb +2 -2
  545. data/test/test_job_cn.rb +3 -3
  546. data/test/test_job_fr.rb +2 -2
  547. data/test/test_job_it.rb +17 -0
  548. data/test/test_job_ja.rb +3 -3
  549. data/test/test_job_kr.rb +3 -3
  550. data/test/test_job_vn.rb +2 -3
  551. data/test/test_locale.rb +2 -2
  552. data/test/test_lorem.rb +6 -2
  553. data/test/test_lorem_ar.rb +3 -4
  554. data/test/test_lorem_br.rb +62 -0
  555. data/test/test_lorem_cn.rb +11 -11
  556. data/test/test_lorem_fr.rb +14 -12
  557. data/test/test_lorem_ie.rb +1 -2
  558. data/test/test_lorem_it.rb +51 -0
  559. data/test/test_lorem_ja.rb +5 -5
  560. data/test/test_lorem_kr.rb +2 -2
  561. data/test/test_lorem_pl.rb +2 -3
  562. data/test/test_lorem_ru.rb +3 -4
  563. data/test/test_lorem_ua.rb +4 -4
  564. data/test/test_module_utils.rb +35 -2
  565. data/test/test_movie.rb +2 -2
  566. data/test/test_music.rb +6 -6
  567. data/test/test_name.rb +7 -3
  568. data/test/test_name_ar.rb +1 -2
  569. data/test/test_name_br.rb +2 -2
  570. data/test/test_name_cn.rb +2 -2
  571. data/test/test_name_cs.rb +3 -4
  572. data/test/test_name_da.rb +5 -5
  573. data/test/test_name_de.rb +2 -2
  574. data/test/test_name_es.rb +1 -2
  575. data/test/test_name_fr.rb +2 -3
  576. data/test/test_name_ga.rb +2 -2
  577. data/test/test_name_gr.rb +2 -2
  578. data/test/test_name_id.rb +1 -2
  579. data/test/test_name_it.rb +2 -3
  580. data/test/test_name_ja.rb +2 -2
  581. data/test/test_name_kh.rb +10 -8
  582. data/test/test_name_kr.rb +2 -2
  583. data/test/test_name_mx.rb +2 -3
  584. data/test/test_name_nb.rb +2 -2
  585. data/test/test_name_nl.rb +2 -2
  586. data/test/test_name_ph.rb +2 -2
  587. data/test/test_name_pl.rb +1 -2
  588. data/test/test_name_ru.rb +38 -48
  589. data/test/test_name_se.rb +2 -2
  590. data/test/test_name_sn.rb +2 -3
  591. data/test/test_name_th.rb +2 -2
  592. data/test/test_name_th_en.rb +2 -2
  593. data/test/test_name_tw.rb +28 -0
  594. data/test/test_name_ua.rb +3 -3
  595. data/test/test_name_vn.rb +2 -2
  596. data/test/test_nato_alphabet.rb +2 -2
  597. data/test/test_number.rb +57 -0
  598. data/test/test_phone_number.rb +3 -3
  599. data/test/test_phone_number_au.rb +5 -6
  600. data/test/test_phone_number_br.rb +12 -5
  601. data/test/test_phone_number_cu.rb +5 -12
  602. data/test/test_phone_number_da.rb +2 -3
  603. data/test/test_phone_number_de.rb +2 -3
  604. data/test/test_phone_number_fr.rb +1 -2
  605. data/test/test_phone_number_id.rb +1 -2
  606. data/test/test_phone_number_it.rb +12 -0
  607. data/test/test_phone_number_ja.rb +63 -0
  608. data/test/test_phone_number_kr.rb +2 -2
  609. data/test/test_phone_number_mx.rb +2 -3
  610. data/test/test_phone_number_nl.rb +3 -4
  611. data/test/test_phone_number_pl.rb +56 -0
  612. data/test/test_phone_number_ru.rb +76 -0
  613. data/test/test_phone_number_se.rb +4 -4
  614. data/test/test_phone_number_sg.rb +10 -10
  615. data/test/test_phone_number_sn.rb +4 -5
  616. data/test/test_phone_number_tw.rb +42 -0
  617. data/test/test_phone_number_ua.rb +38 -0
  618. data/test/test_products.rb +2 -2
  619. data/test/test_sem_ver.rb +18 -0
  620. data/test/test_skill.rb +2 -2
  621. data/test/test_sport_pl.rb +30 -0
  622. data/test/test_sport_ru.rb +30 -0
  623. data/test/test_sport_us.rb +17 -0
  624. data/test/test_sports.rb +2 -2
  625. data/test/test_ssn.rb +2 -2
  626. data/test/test_ssn_mx.rb +2 -3
  627. data/test/test_ssn_se.rb +10 -12
  628. data/test/test_string.rb +8 -8
  629. data/test/test_time.rb +14 -8
  630. data/test/test_tweet.rb +11 -11
  631. data/test/test_unique_utils.rb +31 -7
  632. data/test/test_units.rb +9 -9
  633. data/test/test_units_english.rb +17 -18
  634. data/test/test_units_metric.rb +17 -18
  635. data/test/test_vehicle.rb +32 -5
  636. data/test/test_venue.rb +2 -2
  637. data/test/test_youtube.rb +2 -2
  638. metadata +211 -198
  639. data/lib/ffaker/data/address_jp/city +0 -127
  640. data/lib/ffaker/data/address_jp/designated_city +0 -20
  641. data/lib/ffaker/data/address_jp/street +0 -37
  642. data/lib/ffaker/data/address_jp/tokyo_ward +0 -23
  643. data/lib/ffaker/data/address_jp/village +0 -183
  644. data/lib/ffaker/data/address_jp/ward +0 -188
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerGenderJA < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ GENDER_REGEX = /\A[女男]\z/
9
+
10
+ assert_methods_are_deterministic(FFaker::GenderJP, :random)
11
+
12
+ def setup
13
+ @tester = FFaker::GenderJA
14
+ end
15
+
16
+ def test_random
17
+ assert_match(GENDER_REGEX, @tester.random)
18
+ end
19
+
20
+ def test_sample
21
+ assert_match(GENDER_REGEX, @tester.sample)
22
+ end
23
+
24
+ def test_maybe
25
+ assert_match(GENDER_REGEX, @tester.maybe)
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerGenderJP < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ GENDER_REGEX = /\A[女男]\z/
9
+
10
+ assert_methods_are_deterministic(FFaker::GenderJP, :random)
11
+
12
+ def setup
13
+ @tester = FFaker::GenderJP
14
+ end
15
+
16
+ def test_random
17
+ assert_match(GENDER_REGEX, @tester.random)
18
+ end
19
+
20
+ def test_sample
21
+ assert_match(GENDER_REGEX, @tester.sample)
22
+ end
23
+
24
+ def test_maybe
25
+ assert_match(GENDER_REGEX, @tester.maybe)
26
+ end
27
+ end
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerGenderKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerGenderPL < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ GENDER_REGEX = /\A(kobieta|mężczyzna)\z/
9
+
10
+ assert_methods_are_deterministic(FFaker::GenderPL, :random)
11
+
12
+ def setup
13
+ @tester = FFaker::GenderPL
14
+ end
15
+
16
+ def test_random
17
+ assert_match(GENDER_REGEX, @tester.random)
18
+ end
19
+
20
+ def test_sample
21
+ assert_match(GENDER_REGEX, @tester.sample)
22
+ end
23
+
24
+ def test_maybe
25
+ assert_match(GENDER_REGEX, @tester.maybe)
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerGenderRU < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(FFaker::GenderRU, :binary, :random)
9
+
10
+ def setup
11
+ @tester = FFaker::GenderRU
12
+ end
13
+
14
+ def test_random
15
+ gender_regex = /\A(?:мужчина|женщина|нонбайнари|агендер)\z/
16
+ assert_match(gender_regex, @tester.random)
17
+ end
18
+
19
+ def test_binary
20
+ gender_regex = /\A(?:мужчина|женщина)\z/
21
+ assert_match(gender_regex, @tester.binary)
22
+ end
23
+ end
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestGeolocation < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -30,8 +30,8 @@ class TestGeolocation < Test::Unit::TestCase
30
30
 
31
31
  new_coords = FFaker::Geolocation.boxed_coords(coords[0], coords[1])
32
32
 
33
- assert (lat_min..lat_max).cover?new_coords[0]
34
- assert (lon_min..lon_max).cover?new_coords[1]
33
+ assert (lat_min..lat_max).cover? new_coords[0]
34
+ assert (lon_min..lon_max).cover? new_coords[1]
35
35
  end
36
36
  end
37
37
  end
data/test/test_guid.rb CHANGED
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestGuid < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,4 +1,6 @@
1
- require 'helper'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
2
4
 
3
5
  class TestHealthcareIpsum < Test::Unit::TestCase
4
6
  include DeterministicHelper
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestHealthcareRU < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ SPECIALIZATION_REGEX = /\A[А-Яа-я\ ()-]+\z/
9
+
10
+ assert_methods_are_deterministic(FFaker::HealthcareRU, :doctor_specialization)
11
+
12
+ def setup
13
+ @tester = FFaker::HealthcareRU
14
+ end
15
+
16
+ def test_doctor_specialization
17
+ assert_match(SPECIALIZATION_REGEX, @tester.doctor_specialization)
18
+ end
19
+ end
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestHipsterIpsum < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestHTMLIpsum < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -16,19 +16,19 @@ class TestHTMLIpsum < Test::Unit::TestCase
16
16
  end
17
17
 
18
18
  def test_a
19
- assert_match(/^<a href="#\w+" title="[ \w]+">[ \w]+<\/a>$/i, FFaker::HTMLIpsum.a)
19
+ assert_match(%r{^<a href="#\w+" title="[ \w]+">[ \w]+</a>$}i, FFaker::HTMLIpsum.a)
20
20
  end
21
21
 
22
22
  def test_p
23
23
  # We can't predict the number of times the sentence pattern will repeat
24
24
  # because the FFaker::Lorem methods that we are using adds a random
25
25
  # number on top of what we specify for the count argument.
26
- assert_match(/^<p>([ \w]+\.)+<\/p>$/i, FFaker::HTMLIpsum.p)
26
+ assert_match(%r{^<p>([ \w]+\.)+</p>$}i, FFaker::HTMLIpsum.p)
27
27
  end
28
28
 
29
29
  def test_p_breaks
30
30
  # Here we can at least test how many <br> tags there are.
31
- assert_match(/^<p>(?:[ \w\.]+<br>){2}[ \w\.]+<\/p>$/i, FFaker::HTMLIpsum.p(3, include_breaks: true))
31
+ assert_match(%r{^<p>(?:[ \w.]+<br>){2}[ \w.]+</p>$}i, FFaker::HTMLIpsum.p(3, include_breaks: true))
32
32
  end
33
33
 
34
34
  def test_p_fancy
@@ -38,7 +38,7 @@ class TestHTMLIpsum < Test::Unit::TestCase
38
38
  # account for the other HTML that is being returned.
39
39
  str = FFaker::HTMLIpsum.p(5, fancy: true)
40
40
  assert_match(/^<p>/, str)
41
- assert_match(/<\/p>$/, str)
41
+ assert_match(%r{</p>$}, str)
42
42
  assert str.length > 6, 'string contains more than <p></p>'
43
43
  end
44
44
 
@@ -50,37 +50,37 @@ class TestHTMLIpsum < Test::Unit::TestCase
50
50
  end
51
51
 
52
52
  def test_dl
53
- assert_match(/^<dl>(<dt>[ \w]+<\/dt><dd>[ \w.]+<\/dd>){3}<\/dl>$/i, FFaker::HTMLIpsum.dl(3))
53
+ assert_match(%r{^<dl>(<dt>[ \w]+</dt><dd>[ \w.]+</dd>){3}</dl>$}i, FFaker::HTMLIpsum.dl(3))
54
54
  end
55
55
 
56
56
  def test_ul_short
57
- assert_match(/^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_short(3))
57
+ assert_match(%r{^<ul>(<li>[ \w.]+</li>){3}</ul>$}i, FFaker::HTMLIpsum.ul_short(3))
58
58
  end
59
59
 
60
60
  def test_ul_long
61
- assert_match(/^<ul>(<li>[ \w.]+<\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_long(3))
61
+ assert_match(%r{^<ul>(<li>[ \w.]+</li>){3}</ul>$}i, FFaker::HTMLIpsum.ul_long(3))
62
62
  end
63
63
 
64
64
  def test_ol_short
65
- assert_match(/^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i, FFaker::HTMLIpsum.ol_short(3))
65
+ assert_match(%r{^<ol>(<li>[ \w.]+</li>){3}</ol>$}i, FFaker::HTMLIpsum.ol_short(3))
66
66
  end
67
67
 
68
68
  def test_ol_long
69
- assert_match(/^<ol>(<li>[ \w.]+<\/li>){3}<\/ol>$/i, FFaker::HTMLIpsum.ol_long(3))
69
+ assert_match(%r{^<ol>(<li>[ \w.]+</li>){3}</ol>$}i, FFaker::HTMLIpsum.ol_long(3))
70
70
  end
71
71
 
72
72
  def test_ul_links
73
- assert_match(/^<ul>(<li><a href="#\w+" title="\w+">[ \w]+<\/a><\/li>){3}<\/ul>$/i, FFaker::HTMLIpsum.ul_links(3))
73
+ assert_match(%r{^<ul>(<li><a href="#\w+" title="\w+">[ \w]+</a></li>){3}</ul>$}i, FFaker::HTMLIpsum.ul_links(3))
74
74
  end
75
75
 
76
76
  def test_table
77
- assert_match(/(<td>[ \w]+<\/td>\s*){3}/i, FFaker::HTMLIpsum.table(3))
77
+ assert_match(%r{(<td>[ \w]+</td>\s*){3}}i, FFaker::HTMLIpsum.table(3))
78
78
  end
79
79
 
80
80
  def test_body
81
81
  # We can't reliably predict what's going to end up inside, so just ensure
82
82
  # that we have a complete string.
83
- assert_match(/^<h1>.+<\/pre>$/im, FFaker::HTMLIpsum.body)
83
+ assert_match(%r{^<h1>.+</pre>$}im, FFaker::HTMLIpsum.body)
84
84
  end
85
85
 
86
86
  def test_fancy_string
@@ -90,6 +90,12 @@ class TestHTMLIpsum < Test::Unit::TestCase
90
90
  assert FFaker::HTMLIpsum.fancy_string.length > 1, 'the string is longer than one char'
91
91
  end
92
92
 
93
+ def test_fancy_string_tags
94
+ # It returns a string with at least one HTML tag
95
+ assert_match(%r{(<.*>[\w\s]+</\w+>){1}}i, FFaker::HTMLIpsum.fancy_string(1))
96
+ assert_match(%r{(<.*>[\w\s]+</\w+>){1}}i, FFaker::HTMLIpsum.fancy_string(3))
97
+ end
98
+
93
99
  def test_fancy_string_breaks
94
100
  # We can't reliably predict what's going to end up inside, so just ensure
95
101
  # that we have a complete string.
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerIdentification < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -15,7 +15,6 @@ class TestFakerIdentification < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  def test_drivers_license
18
- ###-###-##-###-#
19
18
  drivers_license_regex = /\A[A-Z]\d{3}-\d{3}-\d{2}-\d{3}-\d{1}\z/
20
19
  assert_match(drivers_license_regex, @tester.drivers_license)
21
20
  end
@@ -29,7 +28,18 @@ class TestFakerIdentification < Test::Unit::TestCase
29
28
  end
30
29
 
31
30
  def test_ethnicity
32
- ethnicity_regex = /\A(African American|Asian\/Pacific Islander|Caucasian|Hispanic|Native American|Multiracial|Other|Prefer not to respond)\z/
31
+ ethnicity_regex = %r{
32
+ \A(
33
+ African\ American|
34
+ Asian/Pacific\ Islander|
35
+ Caucasian|
36
+ Hispanic|
37
+ Native\ American|
38
+ Multiracial|
39
+ Other|
40
+ Prefer\ not\ to\ respond
41
+ )\z
42
+ }x
33
43
  assert_match(ethnicity_regex, @tester.ethnicity)
34
44
  end
35
45
  end
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerIdentificationBR < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,4 +1,6 @@
1
- require 'helper'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
2
4
 
3
5
  class TestFakerIdentificationESCO < Test::Unit::TestCase
4
6
  include Test::Unit::Assertions
@@ -26,7 +28,7 @@ class TestFakerIdentificationESCO < Test::Unit::TestCase
26
28
  end
27
29
 
28
30
  def test_category
29
- assert_match(/\A([a][1-2]|[bc][1-3])\z/i, @tester.driver_license_category)
31
+ assert_match(/\A(a[1-2]|[bc][1-3])\z/i, @tester.driver_license_category)
30
32
  end
31
33
 
32
34
  def test_blood_type
@@ -34,6 +36,6 @@ class TestFakerIdentificationESCO < Test::Unit::TestCase
34
36
  end
35
37
 
36
38
  def test_expedition_date
37
- assert(Date.today >= @tester.expedition_date)
39
+ assert_less_than @tester.expedition_date, Date.today
38
40
  end
39
41
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestIdentificationEC < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(FFaker::IdentificationEC, :ci)
9
+
10
+ def setup
11
+ @tester = FFaker::IdentificationEC
12
+ end
13
+
14
+ def test_ci
15
+ assert_match(/^[0-9]{10}$/, @tester.ci)
16
+ end
17
+
18
+ def test_last_digit
19
+ ci = @tester.ci
20
+ sum = 0
21
+ ci[0..8].chars.each_with_index do |char, index|
22
+ if index.even?
23
+ multiple = char.to_i * 2
24
+ sum += multiple > 9 ? multiple - 9 : multiple
25
+ else
26
+ sum += char.to_i
27
+ end
28
+ end
29
+ mod = sum % 10
30
+ mod = 10 - mod if mod.positive?
31
+ assert(ci[9].to_i == mod)
32
+ end
33
+ end
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerIdentificationES < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
5
  class TestFakerIdentificationESCL < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -12,6 +12,6 @@ class TestFakerIdentificationESCL < Test::Unit::TestCase
12
12
  end
13
13
 
14
14
  def test_rut
15
- assert_match(/\b\d{7,8}\-[k|0-9]/i, @tester.rut)
15
+ assert_match(/\b\d{7,8}-[k|0-9]/i, @tester.rut)
16
16
  end
17
17
  end
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
- # Author Guapolo <github.com/guapolo>
6
5
  class TestIdentificationMX < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
@@ -23,7 +22,9 @@ class TestIdentificationMX < Test::Unit::TestCase
23
22
 
24
23
  def test_curp
25
24
  or_curp_states_abbr = FFaker::IdentificationMX::ESTADOS_CURP.join('|')
26
- re = /\A[a-z][aeioux][a-z]{2}\d{2}[0-1]\d[0-3]\d[hm](?:#{or_curp_states_abbr})[bcdfghjklmnñpqrstvwxyz]{3}[0-9a-z]\d\z/ui
25
+ re = /
26
+ \A[a-z][aeioux][a-z]{2}\d{2}[0-1]\d[0-3]\d[hm](?:#{or_curp_states_abbr})[bcdfghjklmñpqrstvwxyz]{3}[0-9a-z]\d\z
27
+ /uix
27
28
  assert_match(re, FFaker::IdentificationMX.curp)
28
29
  end
29
30
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestIdentificationIN < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::IdentificationIN,
10
+ :aadhaar
11
+ )
12
+
13
+ def setup
14
+ @tester = FFaker::IdentificationIN
15
+ end
16
+
17
+ def test_aadhaar
18
+ assert_match(/\A\d{12}\z/, @tester.aadhaar)
19
+ end
20
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerIdentificationIT < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::IdentificationIT,
10
+ :drivers_license, :ssn, :gender, :ethnicity
11
+ )
12
+
13
+ def setup
14
+ @tester = FFaker::IdentificationIT
15
+ end
16
+
17
+ def test_drivers_license
18
+ drivers_license_regex = /\AU1[1-9]\d{7}[A-Z]\z/
19
+ assert_match(drivers_license_regex, @tester.drivers_license)
20
+ end
21
+
22
+ def test_ssn
23
+ assert_match(/\A\d{20}\z/, @tester.ssn)
24
+ end
25
+
26
+ def test_gender
27
+ assert_match(/\A(Maschio|Femmina)\z/, @tester.gender)
28
+ end
29
+
30
+ def test_ethnicity
31
+ ethnicity_regex = %r{
32
+ \A(
33
+ Afroamericano|
34
+ Asiatico/isolano\ del\ Pacifico|
35
+ Caucasico|
36
+ Ispanico|
37
+ Nativo\ americano|
38
+ Multirazziale|
39
+ Altro|
40
+ Preferisco\ non\ rispondere
41
+ )\z
42
+ }x
43
+ assert_match(ethnicity_regex, @tester.ethnicity)
44
+ end
45
+ end
@@ -1,14 +1,14 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
- class TestFakerIdentificationKr < Test::Unit::TestCase
5
+ class TestFakerIdentificationKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
- assert_methods_are_deterministic(FFaker::IdentificationKr, :rrn)
8
+ assert_methods_are_deterministic(FFaker::IdentificationKR, :rrn)
9
9
 
10
10
  def setup
11
- @tester = FFaker::IdentificationKr
11
+ @tester = FFaker::IdentificationKR
12
12
  end
13
13
 
14
14
  def test_rrn
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerIdentificationPL < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::IdentificationPL,
10
+ :pesel, :identity_card, :drivers_license
11
+ )
12
+
13
+ def setup
14
+ @tester = FFaker::IdentificationPL
15
+ end
16
+
17
+ def test_pesel
18
+ assert_match(/\A\d{11}\z/, @tester.pesel)
19
+ end
20
+
21
+ def test_identity_card
22
+ assert_match(/\A[A-Z]{3}\d{6}\z/, @tester.identity_card)
23
+ end
24
+
25
+ def test_drivers_license
26
+ assert_match(%r{\A\d{5}/\d{2}/\d{4}\z}, @tester.drivers_license)
27
+ end
28
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerIdentificationTW < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(FFaker::IdentificationTW, :id)
9
+
10
+ def setup
11
+ @tester = FFaker::IdentificationTW
12
+ end
13
+
14
+ def test_id
15
+ assert_match(/\A[A-Z][12]\d{8}\z/, @tester.id)
16
+ end
17
+ end