ffaker 2.7.0 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (640) hide show
  1. checksums.yaml +5 -5
  2. data/Changelog.md +115 -0
  3. data/Gemfile +2 -0
  4. data/RANDOM.md +153 -0
  5. data/README.md +25 -4
  6. data/REFERENCE.md +1736 -1117
  7. data/Rakefile +5 -9
  8. data/ffaker.gemspec +15 -6
  9. data/lib/ffaker/address.rb +3 -3
  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 +6 -4
  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 +36 -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 +2 -4
  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 +23 -5
  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/book.rb +12 -1
  48. data/lib/ffaker/boolean.rb +1 -1
  49. data/lib/ffaker/cheesy_lingo.rb +3 -6
  50. data/lib/ffaker/code.rb +37 -0
  51. data/lib/ffaker/color.rb +7 -7
  52. data/lib/ffaker/color_pl.rb +14 -0
  53. data/lib/ffaker/color_ua.rb +1 -1
  54. data/lib/ffaker/company.rb +4 -7
  55. data/lib/ffaker/company_cn.rb +1 -1
  56. data/lib/ffaker/company_fr.rb +35 -0
  57. data/lib/ffaker/company_it.rb +4 -2
  58. data/lib/ffaker/company_ja.rb +24 -0
  59. data/lib/ffaker/company_se.rb +1 -1
  60. data/lib/ffaker/conference.rb +1 -1
  61. data/lib/ffaker/{courses.rb → courses_fr.rb} +3 -1
  62. data/lib/ffaker/currency.rb +5 -1
  63. data/lib/ffaker/data/address/city_suffixes +1 -1
  64. data/lib/ffaker/data/address/country +1 -1
  65. data/lib/ffaker/data/address/country_code +1 -1
  66. data/lib/ffaker/data/address/neighborhood +1 -1
  67. data/lib/ffaker/data/address/street_suffix +1 -1
  68. data/lib/ffaker/data/address_br/city +0 -1
  69. data/lib/ffaker/data/address_br/complement +3 -0
  70. data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
  71. data/lib/ffaker/data/address_br/state +1 -1
  72. data/lib/ffaker/data/address_ca/city +99 -99
  73. data/lib/ffaker/data/address_ca/province +1 -1
  74. data/lib/ffaker/data/address_de/city +1 -1
  75. data/lib/ffaker/data/address_de/state +1 -1
  76. data/lib/ffaker/data/address_fr/city +1 -1
  77. data/lib/ffaker/data/address_fr/region +27 -0
  78. data/lib/ffaker/data/address_gr/city +1 -1
  79. data/lib/ffaker/data/address_gr/region +1 -1
  80. data/lib/ffaker/data/address_gr/street +1 -1
  81. data/lib/ffaker/data/address_in/city +24 -0
  82. data/lib/ffaker/data/address_it/city +111 -0
  83. data/lib/ffaker/data/address_it/region +20 -0
  84. data/lib/ffaker/data/address_ja/city +0 -23
  85. data/lib/ffaker/data/address_mx/ags +11 -0
  86. data/lib/ffaker/data/address_mx/bc +5 -0
  87. data/lib/ffaker/data/address_mx/bcs +5 -0
  88. data/lib/ffaker/data/address_mx/camp +11 -0
  89. data/lib/ffaker/data/address_mx/chih +67 -0
  90. data/lib/ffaker/data/address_mx/chis +118 -0
  91. data/lib/ffaker/data/address_mx/coah +38 -0
  92. data/lib/ffaker/data/address_mx/col +10 -0
  93. data/lib/ffaker/data/address_mx/df +16 -0
  94. data/lib/ffaker/data/address_mx/dgo +39 -0
  95. data/lib/ffaker/data/address_mx/gro +81 -0
  96. data/lib/ffaker/data/address_mx/gto +46 -0
  97. data/lib/ffaker/data/address_mx/hgo +84 -0
  98. data/lib/ffaker/data/address_mx/jal +125 -0
  99. data/lib/ffaker/data/address_mx/mex +125 -0
  100. data/lib/ffaker/data/address_mx/mich +113 -0
  101. data/lib/ffaker/data/address_mx/mor +33 -0
  102. data/lib/ffaker/data/address_mx/nay +20 -0
  103. data/lib/ffaker/data/address_mx/nl +51 -0
  104. data/lib/ffaker/data/address_mx/oax +570 -0
  105. data/lib/ffaker/data/address_mx/pue +217 -0
  106. data/lib/ffaker/data/address_mx/qr +10 -0
  107. data/lib/ffaker/data/address_mx/qro +18 -0
  108. data/lib/ffaker/data/address_mx/sin +18 -0
  109. data/lib/ffaker/data/address_mx/slp +58 -0
  110. data/lib/ffaker/data/address_mx/son +72 -0
  111. data/lib/ffaker/data/address_mx/state +1 -1
  112. data/lib/ffaker/data/address_mx/state_abbr +1 -1
  113. data/lib/ffaker/data/address_mx/tab +17 -0
  114. data/lib/ffaker/data/address_mx/tamps +43 -0
  115. data/lib/ffaker/data/address_mx/tlax +60 -0
  116. data/lib/ffaker/data/address_mx/ver +212 -0
  117. data/lib/ffaker/data/address_mx/yuc +106 -0
  118. data/lib/ffaker/data/address_mx/zac +58 -0
  119. data/lib/ffaker/data/address_ru/city +1 -1
  120. data/lib/ffaker/data/address_se/city +1 -1
  121. data/lib/ffaker/data/address_se/countries +1 -1
  122. data/lib/ffaker/data/address_se/street +1 -1
  123. data/lib/ffaker/data/address_sn/arrondissements +1 -1
  124. data/lib/ffaker/data/address_sn/departements +1 -1
  125. data/lib/ffaker/data/address_sn/regions +1 -1
  126. data/lib/ffaker/data/address_uk/county +1 -1
  127. data/lib/ffaker/data/address_us/state +1 -1
  128. data/lib/ffaker/data/address_us/state_abbr +1 -2
  129. data/lib/ffaker/data/address_us/state_and_territories_abbr +1 -1
  130. data/lib/ffaker/data/animal_br/common_names +423 -0
  131. data/lib/ffaker/data/animal_cn/common_names +141 -0
  132. data/lib/ffaker/data/animal_es/common_names +135 -0
  133. data/lib/ffaker/data/animal_pl/common_names +256 -0
  134. data/lib/ffaker/data/animal_us/common_names +141 -0
  135. data/lib/ffaker/data/aws/ec2_reserved_instance_tenancy +1 -1
  136. data/lib/ffaker/data/aws/ec2_reserved_offering_type +1 -1
  137. data/lib/ffaker/data/aws/ec2_reserved_product_description +1 -1
  138. data/lib/ffaker/data/bank/card_types +12 -0
  139. data/lib/ffaker/data/book/nouns +2 -2
  140. data/lib/ffaker/data/cheesy_lingo/cheesy_phrases +1 -1
  141. data/lib/ffaker/data/cheesy_lingo/cheesy_words +1 -1
  142. data/lib/ffaker/data/color/names_list +1 -1
  143. data/lib/ffaker/data/color_pl/names_list +122 -0
  144. data/lib/ffaker/data/company/bs_mid +1 -1
  145. data/lib/ffaker/data/company/bs_pos +1 -1
  146. data/lib/ffaker/data/company/bs_pre +1 -1
  147. data/lib/ffaker/data/company/catch_mid +1 -1
  148. data/lib/ffaker/data/company/catch_pos +1 -1
  149. data/lib/ffaker/data/company/catch_pre +1 -1
  150. data/lib/ffaker/data/company/position_areas +1 -1
  151. data/lib/ffaker/data/conference/conference_list +1 -1
  152. data/lib/ffaker/data/currency/currency_code +1 -1
  153. data/lib/ffaker/data/currency/currency_name +1 -1
  154. data/lib/ffaker/data/currency/currency_symbol +8 -0
  155. data/lib/ffaker/data/dizzle_ipsum/dizzle_words +1 -1
  156. data/lib/ffaker/data/education/major_noun +1 -1
  157. data/lib/ffaker/data/education/school_suffix +1 -1
  158. data/lib/ffaker/data/education_cn/city +351 -0
  159. data/lib/ffaker/data/education_cn/major +506 -0
  160. data/lib/ffaker/data/education_cn/province +31 -0
  161. data/lib/ffaker/data/education_cn/school_type +27 -0
  162. data/lib/ffaker/data/filesystem/extension +31 -31
  163. data/lib/ffaker/data/food/fruit +1 -1
  164. data/lib/ffaker/data/food/herb_spice +1 -1
  165. data/lib/ffaker/data/food/meat +1 -1
  166. data/lib/ffaker/data/food/vegetable +1 -1
  167. data/lib/ffaker/data/food_pl/diary +14 -0
  168. data/lib/ffaker/data/food_pl/fermented +13 -0
  169. data/lib/ffaker/data/food_pl/fruits +34 -0
  170. data/lib/ffaker/data/food_pl/herbs +20 -0
  171. data/lib/ffaker/data/food_pl/meats +9 -0
  172. data/lib/ffaker/data/food_pl/preserves +10 -0
  173. data/lib/ffaker/data/food_pl/spices +26 -0
  174. data/lib/ffaker/data/food_pl/vegetables +45 -0
  175. data/lib/ffaker/data/freedom_ipsum/freedom_words +161 -0
  176. data/lib/ffaker/data/game/adj_and_adv +18 -0
  177. data/lib/ffaker/data/game/category +84 -0
  178. data/lib/ffaker/data/game/mechanic +182 -0
  179. data/lib/ffaker/data/game/nouns +37 -0
  180. data/lib/ffaker/data/game/prefixes +17 -0
  181. data/lib/ffaker/data/healthcare_ru/doctor_specialization +127 -0
  182. data/lib/ffaker/data/hipster_ipsum/hipster_words +1 -1
  183. data/lib/ffaker/data/identification_mx/estados_curp +1 -1
  184. data/lib/ffaker/data/job/job_adj +1 -1
  185. data/lib/ffaker/data/job/job_noun +1 -1
  186. data/lib/ffaker/data/job/job_prefix +1 -1
  187. data/lib/ffaker/data/job_fr/job_prefixes +1 -1
  188. data/lib/ffaker/data/job_it/job_adj +37 -0
  189. data/lib/ffaker/data/job_it/job_noun +25 -0
  190. data/lib/ffaker/data/job_it/job_prefix +22 -0
  191. data/lib/ffaker/data/locale/language +1 -1
  192. data/lib/ffaker/data/locale/language_code +1 -1
  193. data/lib/ffaker/data/lorem/characters +1 -1
  194. data/lib/ffaker/data/lorem/words +1 -68
  195. data/lib/ffaker/data/lorem_ar/words +1 -1
  196. data/lib/ffaker/data/lorem_br/characters +36 -0
  197. data/lib/ffaker/data/lorem_br/words +183 -0
  198. data/lib/ffaker/data/lorem_cn/words +1 -1
  199. data/lib/ffaker/data/lorem_fr/words +1 -1
  200. data/lib/ffaker/data/lorem_ie/characters +5 -0
  201. data/lib/ffaker/data/lorem_ie/paragraphs +2 -0
  202. data/lib/ffaker/data/lorem_ie/questions +1 -0
  203. data/lib/ffaker/data/lorem_ie/sentences +1 -0
  204. data/lib/ffaker/data/lorem_ie/words +107 -0
  205. data/lib/ffaker/data/lorem_it/words +321 -0
  206. data/lib/ffaker/data/lorem_pl/characters +32 -0
  207. data/lib/ffaker/data/lorem_pl/words +245 -0
  208. data/lib/ffaker/data/movie/adj_and_adv +1 -1
  209. data/lib/ffaker/data/movie/nouns +3 -3
  210. data/lib/ffaker/data/movie/prefixes +1 -1
  211. data/lib/ffaker/data/name/first_names_female +0 -230
  212. data/lib/ffaker/data/name/first_names_male +0 -37
  213. data/lib/ffaker/data/name/last_names +1 -2
  214. data/lib/ffaker/data/name/pronouns +6 -0
  215. data/lib/ffaker/data/name_ar/first_names_female +1 -1
  216. data/lib/ffaker/data/name_ar/first_names_male +1 -1
  217. data/lib/ffaker/data/name_ar/last_names +1 -1
  218. data/lib/ffaker/data/name_cn/first_names +1 -1
  219. data/lib/ffaker/data/name_cn/last_names +1 -1
  220. data/lib/ffaker/data/name_cs/female_first_names +40 -0
  221. data/lib/ffaker/data/name_cs/female_last_names +50 -0
  222. data/lib/ffaker/data/name_cs/male_first_names +88 -0
  223. data/lib/ffaker/data/name_cs/male_last_names +49 -0
  224. data/lib/ffaker/data/name_cs/prefixes +4 -4
  225. data/lib/ffaker/data/name_de/first_names +1 -1
  226. data/lib/ffaker/data/name_de/last_names +1 -1
  227. data/lib/ffaker/data/name_es/first_names_female +184 -0
  228. data/lib/ffaker/data/name_es/first_names_male +165 -0
  229. data/lib/ffaker/data/name_es/last_names +208 -0
  230. data/lib/ffaker/data/name_fr/first_names +1 -1
  231. data/lib/ffaker/data/name_fr/last_names +1 -1
  232. data/lib/ffaker/data/name_ga/first_names_female +1 -1
  233. data/lib/ffaker/data/name_ga/first_names_male +287 -287
  234. data/lib/ffaker/data/name_gr/female_first_names +1 -1
  235. data/lib/ffaker/data/name_gr/female_last_names +1 -1
  236. data/lib/ffaker/data/name_gr/male_first_names +1 -1
  237. data/lib/ffaker/data/name_gr/male_last_names +1 -1
  238. data/lib/ffaker/data/name_in/first_names_female +100 -0
  239. data/lib/ffaker/data/name_in/first_names_male +100 -0
  240. data/lib/ffaker/data/name_in/last_names +100 -0
  241. data/lib/ffaker/data/name_it/first_names +1 -1
  242. data/lib/ffaker/data/name_it/last_names +1 -1
  243. data/lib/ffaker/data/name_ja/first_names +1 -1
  244. data/lib/ffaker/data/name_ja/last_names +1 -1
  245. data/lib/ffaker/data/name_kh/first_names +1 -1
  246. data/lib/ffaker/data/name_kh/nick_names +1 -1
  247. data/lib/ffaker/data/name_kr/first_names +1 -1
  248. data/lib/ffaker/data/name_kr/last_names +1 -1
  249. data/lib/ffaker/data/name_mx/female_first_names +1 -1
  250. data/lib/ffaker/data/name_mx/last_names +1 -1
  251. data/lib/ffaker/data/name_mx/male_first_names +1 -1
  252. data/lib/ffaker/data/name_ph/autochthonous_surnames +1 -1
  253. data/lib/ffaker/data/name_ph/spanish_surnames +1 -1
  254. data/lib/ffaker/data/name_ru/first_names_female +91 -0
  255. data/lib/ffaker/data/name_ru/first_names_male +172 -0
  256. data/lib/ffaker/data/name_ru/last_names_female +100 -0
  257. data/lib/ffaker/data/name_ru/last_names_male +100 -0
  258. data/lib/ffaker/data/name_ru/middle_names_female +65 -0
  259. data/lib/ffaker/data/name_ru/middle_names_male +73 -0
  260. data/lib/ffaker/data/name_se/first_names_female +1 -1
  261. data/lib/ffaker/data/name_se/first_names_male +1 -1
  262. data/lib/ffaker/data/name_se/last_names +1 -1
  263. data/lib/ffaker/data/name_sn/first_names_female +1 -1
  264. data/lib/ffaker/data/name_sn/first_names_male +1 -1
  265. data/lib/ffaker/data/name_sn/last_names +1 -1
  266. data/lib/ffaker/data/name_th/first_names +1 -1
  267. data/lib/ffaker/data/name_th/last_names +1 -1
  268. data/lib/ffaker/data/name_th/nick_names +1 -1
  269. data/lib/ffaker/data/name_tw/first_names +122 -0
  270. data/lib/ffaker/data/name_tw/last_names +100 -0
  271. data/lib/ffaker/data/nato_alphabet/alphabet_codes +26 -0
  272. data/lib/ffaker/data/nato_alphabet/numeric_codes +10 -0
  273. data/lib/ffaker/data/phone_number_ja/four_disit_area_codes +41 -0
  274. data/lib/ffaker/data/phone_number_ja/one_disit_area_codes +3 -0
  275. data/lib/ffaker/data/phone_number_ja/three_disit_area_codes +296 -0
  276. data/lib/ffaker/data/phone_number_ja/two_disit_area_codes +48 -0
  277. data/lib/ffaker/data/phone_number_nl/area_codes +142 -0
  278. data/lib/ffaker/data/phone_number_ru/home_phone_prefixes +107 -0
  279. data/lib/ffaker/data/phone_number_ru/mobile_phone_prefixes +61 -0
  280. data/lib/ffaker/data/phone_number_se/phone_prefix +1 -1
  281. data/lib/ffaker/data/phone_number_ua/home_phone_prefixes +29 -0
  282. data/lib/ffaker/data/phone_number_ua/mobile_phone_prefixes +11 -0
  283. data/lib/ffaker/data/product/adj +1 -1
  284. data/lib/ffaker/data/product/b1 +1 -1
  285. data/lib/ffaker/data/product/noun +4 -1
  286. data/lib/ffaker/data/skill/specialty_end +1 -1
  287. data/lib/ffaker/data/skill/specialty_start +1 -1
  288. data/lib/ffaker/data/skill/tech_skills +1 -1
  289. data/lib/ffaker/data/sport_pl/summer +53 -0
  290. data/lib/ffaker/data/sport_pl/winter +14 -0
  291. data/lib/ffaker/data/sport_ru/summer +68 -0
  292. data/lib/ffaker/data/sport_ru/winter +20 -0
  293. data/lib/ffaker/data/sport_us/names +67 -0
  294. data/lib/ffaker/data/vehicle/color_prefixes +25 -0
  295. data/lib/ffaker/data/vehicle/displacements_list +1 -1
  296. data/lib/ffaker/data/vehicle/fuel_types_list +1 -1
  297. data/lib/ffaker/data/vehicle/makes_list +1 -1
  298. data/lib/ffaker/data/vehicle/transmissions_list +1 -1
  299. data/lib/ffaker/data/vehicle/upholstery_list +1 -1
  300. data/lib/ffaker/data/venue/venue_list +1 -1
  301. data/lib/ffaker/dizzle_ipsum.rb +1 -3
  302. data/lib/ffaker/education.rb +9 -10
  303. data/lib/ffaker/education_cn.rb +37 -0
  304. data/lib/ffaker/filesystem.rb +8 -8
  305. data/lib/ffaker/food.rb +2 -0
  306. data/lib/ffaker/food_pl.rb +65 -0
  307. data/lib/ffaker/freedom_ipsum.rb +20 -0
  308. data/lib/ffaker/game.rb +33 -0
  309. data/lib/ffaker/gender.rb +7 -2
  310. data/lib/ffaker/gender_br.rb +1 -1
  311. data/lib/ffaker/gender_cn.rb +1 -1
  312. data/lib/ffaker/gender_id.rb +0 -1
  313. data/lib/ffaker/gender_it.rb +17 -0
  314. data/lib/ffaker/gender_ja.rb +18 -0
  315. data/lib/ffaker/gender_jp.rb +11 -0
  316. data/lib/ffaker/gender_kr.rb +1 -1
  317. data/lib/ffaker/gender_pl.rb +19 -0
  318. data/lib/ffaker/gender_ru.rb +22 -0
  319. data/lib/ffaker/geolocation.rb +32 -22
  320. data/lib/ffaker/guid.rb +1 -1
  321. data/lib/ffaker/healthcare_ipsum.rb +1 -3
  322. data/lib/ffaker/healthcare_ru.rb +12 -0
  323. data/lib/ffaker/hipster_ipsum.rb +1 -3
  324. data/lib/ffaker/html_ipsum.rb +10 -4
  325. data/lib/ffaker/identification.rb +5 -2
  326. data/lib/ffaker/identification_br.rb +1 -1
  327. data/lib/ffaker/identification_es.rb +1 -1
  328. data/lib/ffaker/identification_es_cl.rb +6 -5
  329. data/lib/ffaker/identification_es_co.rb +2 -3
  330. data/lib/ffaker/identification_in.rb +15 -0
  331. data/lib/ffaker/identification_it.rb +30 -0
  332. data/lib/ffaker/identification_kr.rb +3 -3
  333. data/lib/ffaker/identification_mx.rb +14 -20
  334. data/lib/ffaker/identification_pl.rb +77 -0
  335. data/lib/ffaker/identification_tw.rb +24 -0
  336. data/lib/ffaker/image.rb +48 -0
  337. data/lib/ffaker/internet.rb +19 -26
  338. data/lib/ffaker/internet_se.rb +8 -10
  339. data/lib/ffaker/job.rb +1 -1
  340. data/lib/ffaker/job_br.rb +1 -1
  341. data/lib/ffaker/job_cn.rb +1 -1
  342. data/lib/ffaker/job_fr.rb +1 -1
  343. data/lib/ffaker/job_it.rb +12 -0
  344. data/lib/ffaker/job_ja.rb +0 -1
  345. data/lib/ffaker/job_kr.rb +1 -1
  346. data/lib/ffaker/job_vn.rb +0 -1
  347. data/lib/ffaker/locale.rb +8 -12
  348. data/lib/ffaker/lorem.rb +6 -7
  349. data/lib/ffaker/lorem_ar.rb +1 -1
  350. data/lib/ffaker/lorem_br.rb +45 -0
  351. data/lib/ffaker/lorem_cn.rb +1 -2
  352. data/lib/ffaker/lorem_fr.rb +1 -1
  353. data/lib/ffaker/lorem_ie.rb +40 -0
  354. data/lib/ffaker/lorem_it.rb +39 -0
  355. data/lib/ffaker/lorem_ja.rb +1 -1
  356. data/lib/ffaker/lorem_kr.rb +1 -1
  357. data/lib/ffaker/lorem_pl.rb +60 -0
  358. data/lib/ffaker/lorem_ru.rb +0 -1
  359. data/lib/ffaker/lorem_ua.rb +3 -5
  360. data/lib/ffaker/movie.rb +7 -4
  361. data/lib/ffaker/music.rb +1 -1
  362. data/lib/ffaker/name.rb +5 -1
  363. data/lib/ffaker/name_ar.rb +0 -1
  364. data/lib/ffaker/name_br.rb +1 -1
  365. data/lib/ffaker/name_cn.rb +1 -1
  366. data/lib/ffaker/name_cs.rb +7 -9
  367. data/lib/ffaker/name_da.rb +2 -4
  368. data/lib/ffaker/name_de.rb +1 -3
  369. data/lib/ffaker/name_es.rb +64 -0
  370. data/lib/ffaker/name_fr.rb +1 -2
  371. data/lib/ffaker/name_ga.rb +1 -1
  372. data/lib/ffaker/name_gr.rb +2 -3
  373. data/lib/ffaker/name_id.rb +0 -1
  374. data/lib/ffaker/name_in.rb +39 -0
  375. data/lib/ffaker/name_it.rb +2 -3
  376. data/lib/ffaker/name_ja.rb +1 -1
  377. data/lib/ffaker/name_kh.rb +2 -0
  378. data/lib/ffaker/name_kr.rb +1 -1
  379. data/lib/ffaker/name_mx.rb +4 -6
  380. data/lib/ffaker/name_nb.rb +1 -3
  381. data/lib/ffaker/name_nl.rb +1 -3
  382. data/lib/ffaker/name_ph.rb +1 -3
  383. data/lib/ffaker/name_pl.rb +1 -2
  384. data/lib/ffaker/name_ru.rb +32 -71
  385. data/lib/ffaker/name_se.rb +1 -3
  386. data/lib/ffaker/name_sn.rb +3 -6
  387. data/lib/ffaker/name_th.rb +1 -1
  388. data/lib/ffaker/name_th_en.rb +2 -2
  389. data/lib/ffaker/name_tw.rb +20 -0
  390. data/lib/ffaker/name_ua.rb +1 -3
  391. data/lib/ffaker/name_vn.rb +1 -1
  392. data/lib/ffaker/nato_alphabet.rb +2 -4
  393. data/lib/ffaker/number.rb +26 -0
  394. data/lib/ffaker/phone_number.rb +1 -1
  395. data/lib/ffaker/phone_number_au.rb +11 -12
  396. data/lib/ffaker/phone_number_br.rb +16 -14
  397. data/lib/ffaker/phone_number_ch.rb +1 -1
  398. data/lib/ffaker/phone_number_cu.rb +18 -27
  399. data/lib/ffaker/phone_number_da.rb +1 -3
  400. data/lib/ffaker/phone_number_de.rb +1 -2
  401. data/lib/ffaker/phone_number_fr.rb +50 -13
  402. data/lib/ffaker/phone_number_id.rb +2 -6
  403. data/lib/ffaker/phone_number_it.rb +9 -7
  404. data/lib/ffaker/phone_number_ja.rb +88 -0
  405. data/lib/ffaker/phone_number_kr.rb +1 -1
  406. data/lib/ffaker/phone_number_mx.rb +1 -2
  407. data/lib/ffaker/phone_number_nl.rb +9 -12
  408. data/lib/ffaker/phone_number_pl.rb +68 -0
  409. data/lib/ffaker/phone_number_ru.rb +120 -0
  410. data/lib/ffaker/phone_number_se.rb +1 -1
  411. data/lib/ffaker/phone_number_sg.rb +1 -1
  412. data/lib/ffaker/phone_number_sn.rb +12 -19
  413. data/lib/ffaker/phone_number_tw.rb +49 -0
  414. data/lib/ffaker/phone_number_ua.rb +42 -0
  415. data/lib/ffaker/product.rb +10 -12
  416. data/lib/ffaker/sem_ver.rb +19 -0
  417. data/lib/ffaker/skill.rb +1 -1
  418. data/lib/ffaker/sport.rb +4 -0
  419. data/lib/ffaker/sport_pl.rb +25 -0
  420. data/lib/ffaker/sport_ru.rb +25 -0
  421. data/lib/ffaker/sport_us.rb +12 -0
  422. data/lib/ffaker/ssn.rb +7 -2
  423. data/lib/ffaker/ssn_mx.rb +1 -2
  424. data/lib/ffaker/ssn_se.rb +14 -42
  425. data/lib/ffaker/string.rb +17 -16
  426. data/lib/ffaker/time.rb +39 -21
  427. data/lib/ffaker/tweet.rb +4 -4
  428. data/lib/ffaker/unit.rb +10 -11
  429. data/lib/ffaker/unit_english.rb +19 -22
  430. data/lib/ffaker/unit_metric.rb +16 -19
  431. data/lib/ffaker/utils/array_utils.rb +8 -5
  432. data/lib/ffaker/utils/module_utils.rb +26 -4
  433. data/lib/ffaker/utils/random_utils.rb +4 -0
  434. data/lib/ffaker/utils/unique_utils.rb +0 -1
  435. data/lib/ffaker/vehicle.rb +67 -9
  436. data/lib/ffaker/venue.rb +1 -1
  437. data/lib/ffaker/youtube.rb +1 -1
  438. data/lib/ffaker.rb +199 -17
  439. data/lib/version.rb +5 -0
  440. data/scripts/benchmark.rb +12 -11
  441. data/scripts/profiling.rb +3 -1
  442. data/scripts/reference.rb +21 -17
  443. data/test/helper.rb +38 -1
  444. data/test/test_address.rb +2 -2
  445. data/test/test_address_au.rb +7 -8
  446. data/test/test_address_br.rb +17 -4
  447. data/test/test_address_ca.rb +2 -2
  448. data/test/test_address_ch.rb +2 -2
  449. data/test/test_address_ch_de.rb +2 -2
  450. data/test/test_address_ch_fr.rb +2 -2
  451. data/test/test_address_ch_it.rb +2 -2
  452. data/test/test_address_da.rb +2 -2
  453. data/test/test_address_de.rb +2 -2
  454. data/test/test_address_fi.rb +5 -6
  455. data/test/test_address_fr.rb +3 -4
  456. data/test/test_address_gr.rb +2 -2
  457. data/test/test_address_id.rb +2 -3
  458. data/test/test_address_in.rb +2 -2
  459. data/test/test_address_it.rb +12 -0
  460. data/test/test_address_ja.rb +2 -3
  461. data/test/test_address_kr.rb +1 -2
  462. data/test/test_address_mx.rb +2 -3
  463. data/test/test_address_nl.rb +3 -3
  464. data/test/test_address_pl.rb +1 -2
  465. data/test/test_address_ru.rb +2 -2
  466. data/test/test_address_se.rb +5 -5
  467. data/test/test_address_sn.rb +2 -5
  468. data/test/test_address_ua.rb +2 -2
  469. data/test/test_address_uk.rb +2 -2
  470. data/test/test_address_us.rb +11 -2
  471. data/test/test_airline.rb +2 -2
  472. data/test/test_animal.rb +2 -2
  473. data/test/test_animal_br.rb +17 -0
  474. data/test/test_animal_cn.rb +17 -0
  475. data/test/test_animal_es.rb +17 -0
  476. data/test/test_animal_pl.rb +17 -0
  477. data/test/test_animal_us.rb +17 -0
  478. data/test/test_array_utils.rb +3 -3
  479. data/test/test_avatar.rb +5 -3
  480. data/test/test_aws.rb +3 -3
  481. data/test/test_bacon_ipsum.rb +2 -2
  482. data/test/test_bank.rb +53 -0
  483. data/test/test_book.rb +10 -5
  484. data/test/test_boolean.rb +3 -3
  485. data/test/test_cheesy_lingo.rb +5 -3
  486. data/test/test_code.rb +39 -0
  487. data/test/test_color.rb +5 -5
  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_currency.rb +3 -3
  500. data/test/test_dizzle_ipsum.rb +2 -2
  501. data/test/test_education.rb +2 -2
  502. data/test/test_education_cn.rb +29 -0
  503. data/test/{test_faker.rb → test_ffaker.rb} +7 -3
  504. data/test/test_filesystem.rb +13 -5
  505. data/test/test_food.rb +3 -3
  506. data/test/test_food_pl.rb +61 -0
  507. data/test/test_freedom_ipsum.rb +21 -0
  508. data/test/test_game.rb +28 -0
  509. data/test/test_gender.rb +9 -4
  510. data/test/test_gender_br.rb +2 -2
  511. data/test/test_gender_cn.rb +2 -2
  512. data/test/test_gender_id.rb +1 -2
  513. data/test/test_gender_it.rb +27 -0
  514. data/test/test_gender_ja.rb +27 -0
  515. data/test/test_gender_jp.rb +27 -0
  516. data/test/test_gender_kr.rb +2 -2
  517. data/test/test_gender_pl.rb +27 -0
  518. data/test/test_gender_ru.rb +23 -0
  519. data/test/test_geolocation.rb +4 -4
  520. data/test/test_guid.rb +2 -2
  521. data/test/test_healthcare_ipsum.rb +3 -1
  522. data/test/test_healthcare_ru.rb +19 -0
  523. data/test/test_hipster_ipsum.rb +3 -3
  524. data/test/test_html_ipsum.rb +20 -14
  525. data/test/test_identification.rb +3 -3
  526. data/test/test_identification_br.rb +2 -2
  527. data/test/test_identification_co.rb +5 -3
  528. data/test/test_identification_es.rb +2 -2
  529. data/test/test_identification_es_cl.rb +3 -3
  530. data/test/test_identification_es_mx.rb +2 -3
  531. data/test/test_identification_in.rb +20 -0
  532. data/test/test_identification_it.rb +34 -0
  533. data/test/test_identification_kr.rb +2 -2
  534. data/test/test_identification_pl.rb +28 -0
  535. data/test/test_identification_tw.rb +17 -0
  536. data/test/test_image.rb +51 -0
  537. data/test/test_internet.rb +16 -16
  538. data/test/test_internet_se.rb +7 -7
  539. data/test/test_job.rb +2 -2
  540. data/test/test_job_br.rb +2 -2
  541. data/test/test_job_cn.rb +3 -3
  542. data/test/test_job_fr.rb +2 -2
  543. data/test/test_job_it.rb +17 -0
  544. data/test/test_job_ja.rb +3 -3
  545. data/test/test_job_kr.rb +3 -3
  546. data/test/test_job_vn.rb +2 -3
  547. data/test/test_locale.rb +2 -2
  548. data/test/test_lorem.rb +6 -2
  549. data/test/test_lorem_ar.rb +3 -4
  550. data/test/test_lorem_br.rb +62 -0
  551. data/test/test_lorem_cn.rb +8 -8
  552. data/test/test_lorem_fr.rb +15 -13
  553. data/test/test_lorem_ie.rb +52 -0
  554. data/test/test_lorem_it.rb +51 -0
  555. data/test/test_lorem_ja.rb +5 -5
  556. data/test/test_lorem_kr.rb +5 -5
  557. data/test/test_lorem_pl.rb +51 -0
  558. data/test/test_lorem_ru.rb +4 -5
  559. data/test/test_lorem_ua.rb +5 -5
  560. data/test/test_module_utils.rb +2 -2
  561. data/test/test_movie.rb +2 -2
  562. data/test/test_music.rb +6 -6
  563. data/test/test_name.rb +7 -3
  564. data/test/test_name_ar.rb +1 -2
  565. data/test/test_name_br.rb +2 -2
  566. data/test/test_name_cn.rb +2 -2
  567. data/test/test_name_cs.rb +3 -4
  568. data/test/test_name_da.rb +6 -6
  569. data/test/test_name_de.rb +2 -2
  570. data/test/test_name_es.rb +70 -0
  571. data/test/test_name_fr.rb +2 -3
  572. data/test/test_name_ga.rb +2 -2
  573. data/test/test_name_gr.rb +2 -2
  574. data/test/test_name_id.rb +1 -2
  575. data/test/test_name_it.rb +2 -3
  576. data/test/test_name_ja.rb +2 -2
  577. data/test/test_name_kh.rb +10 -8
  578. data/test/test_name_kr.rb +2 -2
  579. data/test/test_name_mx.rb +2 -3
  580. data/test/test_name_nb.rb +2 -2
  581. data/test/test_name_nl.rb +2 -2
  582. data/test/test_name_ph.rb +3 -3
  583. data/test/test_name_pl.rb +1 -2
  584. data/test/test_name_ru.rb +38 -48
  585. data/test/test_name_se.rb +2 -2
  586. data/test/test_name_sn.rb +2 -3
  587. data/test/test_name_th.rb +2 -2
  588. data/test/test_name_th_en.rb +2 -2
  589. data/test/test_name_tw.rb +28 -0
  590. data/test/test_name_ua.rb +4 -4
  591. data/test/test_name_vn.rb +2 -2
  592. data/test/test_nato_alphabet.rb +2 -2
  593. data/test/test_number.rb +45 -0
  594. data/test/test_phone_number.rb +3 -3
  595. data/test/test_phone_number_au.rb +5 -6
  596. data/test/test_phone_number_br.rb +12 -5
  597. data/test/test_phone_number_cu.rb +5 -12
  598. data/test/test_phone_number_da.rb +2 -3
  599. data/test/test_phone_number_de.rb +2 -3
  600. data/test/test_phone_number_fr.rb +57 -0
  601. data/test/test_phone_number_id.rb +1 -2
  602. data/test/test_phone_number_it.rb +12 -0
  603. data/test/test_phone_number_ja.rb +63 -0
  604. data/test/test_phone_number_kr.rb +2 -2
  605. data/test/test_phone_number_mx.rb +2 -3
  606. data/test/test_phone_number_nl.rb +2 -3
  607. data/test/test_phone_number_pl.rb +56 -0
  608. data/test/test_phone_number_ru.rb +76 -0
  609. data/test/test_phone_number_se.rb +5 -5
  610. data/test/test_phone_number_sg.rb +2 -2
  611. data/test/test_phone_number_sn.rb +4 -5
  612. data/test/test_phone_number_tw.rb +42 -0
  613. data/test/test_phone_number_ua.rb +38 -0
  614. data/test/test_products.rb +2 -2
  615. data/test/test_sem_ver.rb +18 -0
  616. data/test/test_skill.rb +2 -2
  617. data/test/test_sport_pl.rb +30 -0
  618. data/test/test_sport_ru.rb +30 -0
  619. data/test/test_sport_us.rb +17 -0
  620. data/test/test_sports.rb +2 -2
  621. data/test/test_ssn.rb +18 -4
  622. data/test/test_ssn_mx.rb +2 -3
  623. data/test/test_ssn_se.rb +10 -12
  624. data/test/test_string.rb +8 -8
  625. data/test/test_time.rb +61 -18
  626. data/test/test_tweet.rb +11 -11
  627. data/test/test_unique_utils.rb +2 -2
  628. data/test/test_units.rb +3 -3
  629. data/test/test_units_english.rb +2 -3
  630. data/test/test_units_metric.rb +2 -3
  631. data/test/test_vehicle.rb +10 -5
  632. data/test/test_venue.rb +2 -2
  633. data/test/test_youtube.rb +2 -2
  634. metadata +402 -143
  635. data/lib/ffaker/data/address_jp/city +0 -127
  636. data/lib/ffaker/data/address_jp/designated_city +0 -20
  637. data/lib/ffaker/data/address_jp/street +0 -37
  638. data/lib/ffaker/data/address_jp/tokyo_ward +0 -23
  639. data/lib/ffaker/data/address_jp/village +0 -183
  640. data/lib/ffaker/data/address_jp/ward +0 -188
data/test/test_name_cs.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 TestFakerNameCS < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -16,7 +16,7 @@ class TestFakerNameCS < Test::Unit::TestCase
16
16
 
17
17
  def test_name
18
18
  @words = @tester.name.split
19
- assert_include([2, 3, 4], @words.size) # just name, or prefix, or prefix+suffix
19
+ assert_include([2, 3, 4], @words.size)
20
20
  end
21
21
 
22
22
  def test_name_sex
@@ -61,7 +61,6 @@ class TestFakerNameCS < Test::Unit::TestCase
61
61
 
62
62
  private
63
63
 
64
- # checks if every name is of the same sex
65
64
  def same_sex?(words, sex = :any)
66
65
  (sex == :any ? %i[male female] : [sex]).any? do |s|
67
66
  words.all? do |word|
data/test/test_name_da.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 TestFakerNameDA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -10,7 +10,7 @@ class TestFakerNameDA < Test::Unit::TestCase
10
10
  :any_name, :male_name, :female_name, :last_name, :prefix
11
11
  )
12
12
 
13
- RU_REGEX = /[А-Я][а-я]+/
13
+ RU_REGEX = /[А-Я][а-я]+/.freeze
14
14
 
15
15
  def setup
16
16
  @tester = FFaker::NameDA
@@ -23,18 +23,18 @@ class TestFakerNameDA < Test::Unit::TestCase
23
23
  end
24
24
 
25
25
  def test_any_name
26
- assert @tester.any_name.count(' ') < 3
26
+ assert_less_than @tester.any_name.count(' '), 3
27
27
  end
28
28
 
29
29
  def test_male_name
30
30
  regexp = /#{@tester::MALE_FIRST_NAMES.join('|')}/
31
- assert @tester.male_name.count(' ') < 3
31
+ assert_less_than @tester.male_name.count(' '), 3
32
32
  assert_match(regexp, @tester.male_name)
33
33
  end
34
34
 
35
35
  def test_female_name
36
36
  regexp = /#{@tester::FEMALE_FIRST_NAMES.join('|')}/
37
- assert @tester.female_name.count(' ') < 3
37
+ assert_less_than @tester.female_name.count(' '), 3
38
38
  assert_match(regexp, @tester.female_name)
39
39
  end
40
40
 
data/test/test_name_de.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 TestFakerNameDE < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerNameES < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::NameES,
10
+ :name, :name_with_prefix, :first_name, :first_name_female, :first_name_male,
11
+ :last_name, :prefix, :female_prefix, :male_prefix
12
+ )
13
+
14
+ def setup
15
+ @tester = FFaker::NameES
16
+ end
17
+
18
+ def test_name
19
+ assert_match(/\A[a-zA-ZáéíóúñÁÉÍÓÚç\s]+\z/, @tester.name)
20
+ end
21
+
22
+ def test_name_with_prefix
23
+ prefix, name, last_name = @tester.name_with_prefix.split(/\s+/)
24
+ assert_include(@tester::PREFIXES, prefix)
25
+ refute_empty(name)
26
+ refute_empty(last_name)
27
+ end
28
+
29
+ def test_female_name_with_prefix
30
+ prefix, name, last_name = @tester.female_name_with_prefix.split(/\s+/)
31
+ assert_include(@tester::FEMALE_PREFIXES, prefix)
32
+ assert_include(@tester::FIRST_NAMES_FEMALE, name)
33
+ refute_empty(last_name)
34
+ end
35
+
36
+ def test_male_name_with_prefix
37
+ prefix, name, last_name = @tester.male_name_with_prefix.split(/\s+/)
38
+ assert_include(@tester::MALE_PREFIXES, prefix)
39
+ assert_include(@tester::FIRST_NAMES_MALE, name)
40
+ refute_empty(last_name)
41
+ end
42
+
43
+ def test_first_name
44
+ assert_include(@tester::FIRST_NAMES, @tester.first_name)
45
+ end
46
+
47
+ def test_first_name_female
48
+ assert_include @tester::FIRST_NAMES_FEMALE, @tester.first_name_female
49
+ end
50
+
51
+ def test_first_name_male
52
+ assert_include @tester::FIRST_NAMES_MALE, @tester.first_name_male
53
+ end
54
+
55
+ def test_last_name
56
+ assert_include(@tester::LAST_NAMES, @tester.last_name)
57
+ end
58
+
59
+ def test_prefix
60
+ assert_include(@tester::PREFIXES, @tester.prefix)
61
+ end
62
+
63
+ def test_female_prefix
64
+ assert_include(@tester::FEMALE_PREFIXES, @tester.female_prefix)
65
+ end
66
+
67
+ def test_male_prefix
68
+ assert_include(@tester::MALE_PREFIXES, @tester.male_prefix)
69
+ end
70
+ end
data/test/test_name_fr.rb CHANGED
@@ -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: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
6
5
  class TestFakerNameFR < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
data/test/test_name_ga.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 TestFakerNameGa < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_gr.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 TestFakerNameGR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_id.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
- # encoding: UTF-8
3
2
 
4
- require 'helper'
3
+ require_relative 'helper'
5
4
 
6
5
  class TestFakerNameID < Test::Unit::TestCase
7
6
  include DeterministicHelper
data/test/test_name_it.rb CHANGED
@@ -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: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
6
5
  class TestFakerNameIT < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
data/test/test_name_ja.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 TestFakerNameJA < Test::Unit::TestCase
6
6
  class << self
data/test/test_name_kh.rb CHANGED
@@ -1,4 +1,6 @@
1
- require 'helper'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
2
4
 
3
5
  class TestFakerNameKH < Test::Unit::TestCase
4
6
  include DeterministicHelper
@@ -9,24 +11,24 @@ class TestFakerNameKH < Test::Unit::TestCase
9
11
  )
10
12
 
11
13
  def setup
12
- @name_KH = FFaker::NameKH
14
+ @name_kh = FFaker::NameKH
13
15
  end
14
16
 
15
17
  def test_last_name
16
- assert_include @name_KH::LAST_NAMES, @name_KH.last_name
18
+ assert_include @name_kh::LAST_NAMES, @name_kh.last_name
17
19
  end
18
20
 
19
21
  def test_first_name
20
- assert_include @name_KH::FIRST_NAMES, @name_KH.first_name
22
+ assert_include @name_kh::FIRST_NAMES, @name_kh.first_name
21
23
  end
22
24
 
23
25
  def test_nick_name
24
- assert_include @name_KH::NICK_NAMES, @name_KH.nick_name
26
+ assert_include @name_kh::NICK_NAMES, @name_kh.nick_name
25
27
  end
26
28
 
27
29
  def test_name
28
- last_name, first_name = @name_KH.name.split(' ')
29
- assert_include @name_KH::FIRST_NAMES, first_name
30
- assert_include @name_KH::LAST_NAMES, last_name
30
+ last_name, first_name = @name_kh.name.split(' ')
31
+ assert_include @name_kh::FIRST_NAMES, first_name
32
+ assert_include @name_kh::LAST_NAMES, last_name
31
33
  end
32
34
  end
data/test/test_name_kr.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 TestFakerNameKR < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_mx.rb CHANGED
@@ -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 TestFakerNameMX < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
data/test/test_name_nb.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 TestFakerNameNB < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_nl.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 TestFakerNameNL < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_ph.rb CHANGED
@@ -1,11 +1,11 @@
1
- # encoding: utf-8
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
7
7
 
8
- PH_REGEXP = /\A([\wñÑú-]+\.? ?){2,5}\z/
8
+ PH_REGEXP = /\A([\wñÑú-]+\.? ?){2,5}\z/.freeze
9
9
 
10
10
  assert_methods_are_deterministic(
11
11
  FFaker::NamePH,
data/test/test_name_pl.rb CHANGED
@@ -1,7 +1,6 @@
1
- # encoding: UTF-8
2
1
  # frozen_string_literal: true
3
2
 
4
- require 'helper'
3
+ require_relative 'helper'
5
4
 
6
5
  class TestFakerNamePL < Test::Unit::TestCase
7
6
  include DeterministicHelper
data/test/test_name_ru.rb CHANGED
@@ -1,15 +1,18 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
- class TestFakerNameRU < Test::Unit::TestCase
5
+ class TestNameRU < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
- RU_REGEX = /[А-Я][а-я]+/
8
+ RU_REGEX = /\A[а-яА-Я]{2,}\z/.freeze
9
+ RU_REGEX_MULTIPLE_WORDS = /\A[а-яА-Я\s]+\z/.freeze
9
10
 
10
11
  assert_methods_are_deterministic(
11
12
  FFaker::NameRU,
12
- :name, :last_name, :first_name, :patronymic
13
+ :name, :first_name, :last_name, :female_name, :male_name,
14
+ :first_name_female, :first_name_male, :middle_name_female,
15
+ :middle_name_male, :last_name_female, :last_name_male
13
16
  )
14
17
 
15
18
  def setup
@@ -17,70 +20,57 @@ class TestFakerNameRU < Test::Unit::TestCase
17
20
  end
18
21
 
19
22
  def test_name
20
- @words = @tester.name.split
21
- assert_include [2, 3], @words.size
22
- assert @words.all? { |word| word.match RU_REGEX }
23
+ assert_match(RU_REGEX_MULTIPLE_WORDS, @tester.name)
24
+ assert_include [1, 2, 3], @tester.name.split(' ').count
23
25
  end
24
26
 
25
- def test_name_sex
26
- @words = @tester.name.split
27
- assert same_sex?(@words)
27
+ def test_first_name
28
+ assert_include @tester::FIRST_NAMES, @tester.first_name
29
+ assert_match(RU_REGEX, @tester.first_name)
28
30
  end
29
31
 
30
32
  def test_last_name
33
+ assert_include @tester::LAST_NAMES, @tester.last_name
31
34
  assert_match(RU_REGEX, @tester.last_name)
32
35
  end
33
36
 
34
- def test_male_last_name
35
- assert_include @tester::LAST_NAMES[:male], @tester.last_name(:male)
37
+ def test_female_name
38
+ assert_match(RU_REGEX_MULTIPLE_WORDS, @tester.female_name)
39
+ assert_include [1, 2, 3], @tester.female_name.split(' ').count
36
40
  end
37
41
 
38
- def test_first_name
39
- assert_match(RU_REGEX, @tester.first_name)
42
+ def test_male_name
43
+ assert_match(RU_REGEX_MULTIPLE_WORDS, @tester.male_name)
44
+ assert_include [1, 2, 3], @tester.male_name.split(' ').count
40
45
  end
41
46
 
42
- def test_male_first_name
43
- assert_include @tester::FIRST_NAMES[:male], @tester.first_name(:male)
47
+ def test_first_name_female
48
+ assert_include @tester::FIRST_NAMES_FEMALE, @tester.first_name_female
49
+ assert_match(RU_REGEX, @tester.first_name_female)
44
50
  end
45
51
 
46
- def test_patronymic
47
- assert_match(RU_REGEX, @tester.patronymic)
52
+ def test_first_name_male
53
+ assert_include @tester::FIRST_NAMES_MALE, @tester.first_name_male
54
+ assert_match(RU_REGEX, @tester.first_name_male)
48
55
  end
49
56
 
50
- def test_male_patronymic
51
- assert_include @tester::PATRONYMICS[:male], @tester.patronymic(:male)
57
+ def test_middle_name_female
58
+ assert_include @tester::MIDDLE_NAMES_FEMALE, @tester.middle_name_female
59
+ assert_match(RU_REGEX, @tester.middle_name_female)
52
60
  end
53
61
 
54
- def test_with_same_sex
55
- names = []
56
- @tester.with_same_sex do
57
- names << @tester.last_name
58
- names << @tester.first_name
59
- names << @tester.patronymic
60
- end
61
- assert same_sex?(names)
62
+ def test_middle_name_male
63
+ assert_include @tester::MIDDLE_NAMES_MALE, @tester.middle_name_male
64
+ assert_match(RU_REGEX, @tester.middle_name_male)
62
65
  end
63
66
 
64
- def test_with_same_sex_for_male
65
- names = []
66
- @tester.with_same_sex(:male) do
67
- names << @tester.last_name
68
- names << @tester.first_name
69
- names << @tester.patronymic
70
- end
71
- assert same_sex?(names, :male)
67
+ def test_last_name_female
68
+ assert_include @tester::LAST_NAMES_FEMALE, @tester.last_name_female
69
+ assert_match(RU_REGEX, @tester.last_name_female)
72
70
  end
73
71
 
74
- private
75
-
76
- # checks if every name is of the same sex
77
- def same_sex?(words, sex = :any)
78
- (sex == :any ? %i[male female] : [sex]).any? do |s|
79
- words.all? do |word|
80
- [@tester::LAST_NAMES, @tester::FIRST_NAMES, @tester::PATRONYMICS].any? do |names|
81
- names[s].include?(word)
82
- end
83
- end
84
- end
72
+ def test_last_name_male
73
+ assert_include @tester::LAST_NAMES_MALE, @tester.last_name_male
74
+ assert_match(RU_REGEX, @tester.last_name_male)
85
75
  end
86
76
  end
data/test/test_name_se.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 TestFakerNameSE < Test::Unit::TestCase
6
6
  include DeterministicHelper
data/test/test_name_sn.rb CHANGED
@@ -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: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
6
5
  class TestFakerNameSn < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
data/test/test_name_th.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 TestFakerNameTH < 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 TestFakerNameTHEN < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class TestFakerNameTW < Test::Unit::TestCase
6
+ include DeterministicHelper
7
+
8
+ assert_methods_are_deterministic(
9
+ FFaker::NameTW,
10
+ :last_name, :first_name, :name
11
+ )
12
+
13
+ def setup
14
+ @tester = FFaker::NameTW
15
+ end
16
+
17
+ def test_last_name
18
+ assert_include @tester::LAST_NAMES, @tester.last_name
19
+ end
20
+
21
+ def test_first_name
22
+ assert_include @tester::FIRST_NAMES, @tester.first_name
23
+ end
24
+
25
+ def test_name
26
+ assert_match(/\A.{2,}\z/, @tester.name)
27
+ end
28
+ end
data/test/test_name_ua.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 TestNameUA < Test::Unit::TestCase
6
6
  include DeterministicHelper
@@ -15,8 +15,8 @@ class TestNameUA < Test::Unit::TestCase
15
15
  def setup
16
16
  @tester = FFaker::NameUA
17
17
 
18
- @single_word_name_regexp = /\A[а-яА-ЯіїєґІЇЄҐ’\-]+\z/
19
- @multiple_words_name_regexp = /\A[а-яА-ЯіїєґІЇЄҐ’\-\s]+\z/
18
+ @single_word_name_regexp = /\A[а-яА-ЯіїєґІЇЄҐ’\-]+\z/.freeze
19
+ @multiple_words_name_regexp = /\A[а-яА-ЯіїєґІЇЄҐ’\-\s]+\z/.freeze
20
20
  end
21
21
 
22
22
  def test_first_name_male
data/test/test_name_vn.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 TestNameVN < 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 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,8 +1,8 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'helper'
3
+ require_relative 'helper'
4
4
 
5
- class TestPhoneNumer < Test::Unit::TestCase
5
+ class TestPhoneNumber < Test::Unit::TestCase
6
6
  include DeterministicHelper
7
7
 
8
8
  assert_methods_are_deterministic(
@@ -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: wiseleyb<wiseleyb@gmail.com>
6
5
  class TestPhoneNumberAU < Test::Unit::TestCase
7
6
  include DeterministicHelper
8
7
 
@@ -20,17 +19,17 @@ class TestPhoneNumberAU < Test::Unit::TestCase
20
19
  end
21
20
 
22
21
  def test_mobile_phone_prefix
23
- assert_include(FFaker::PhoneNumberAU::MobileOperatorsPrefix,
22
+ assert_include(FFaker::PhoneNumberAU::MOBILE_OPERATORS_PREFIX,
24
23
  @tester.mobile_phone_prefix)
25
24
  end
26
25
 
27
26
  def test_home_work_phone_prefix
28
- assert_include(FFaker::PhoneNumberAU::HomeWorkOperatorsPrefix,
27
+ assert_include(FFaker::PhoneNumberAU::HOME_WORK_OPERATORS_PREFIX,
29
28
  @tester.home_work_phone_prefix)
30
29
  end
31
30
 
32
31
  def test_phone_prefix
33
- assert_include(FFaker::PhoneNumberAU::OperatorsPrefix,
32
+ assert_include(FFaker::PhoneNumberAU::OPERATORS_PREFIX,
34
33
  @tester.phone_prefix)
35
34
  end
36
35