ffaker 2.10.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +217 -15
- data/Gemfile +17 -0
- data/README.md +43 -10
- data/REFERENCE.md +1681 -1241
- data/Rakefile +20 -55
- data/bin/console +9 -0
- data/ffaker.gemspec +17 -23
- data/lib/ffaker/address.rb +7 -7
- data/lib/ffaker/address_au.rb +8 -10
- data/lib/ffaker/address_br.rb +16 -4
- data/lib/ffaker/address_ca.rb +3 -3
- data/lib/ffaker/address_ch.rb +1 -3
- data/lib/ffaker/address_ch_de.rb +1 -3
- data/lib/ffaker/address_ch_fr.rb +1 -3
- data/lib/ffaker/address_ch_it.rb +1 -3
- data/lib/ffaker/address_da.rb +1 -3
- data/lib/ffaker/address_de.rb +1 -3
- data/lib/ffaker/address_fi.rb +1 -3
- data/lib/ffaker/address_fr.rb +9 -9
- data/lib/ffaker/address_gr.rb +1 -3
- data/lib/ffaker/address_id.rb +0 -3
- data/lib/ffaker/address_in.rb +5 -3
- data/lib/ffaker/address_it.rb +33 -0
- data/lib/ffaker/address_ja.rb +0 -3
- data/lib/ffaker/address_kr.rb +0 -1
- data/lib/ffaker/address_mx.rb +3 -471
- data/lib/ffaker/address_nl.rb +2 -6
- data/lib/ffaker/address_pl.rb +0 -2
- data/lib/ffaker/address_ru.rb +1 -3
- data/lib/ffaker/address_se.rb +1 -3
- data/lib/ffaker/address_sn.rb +1 -4
- data/lib/ffaker/address_ua.rb +3 -5
- data/lib/ffaker/address_uk.rb +1 -3
- data/lib/ffaker/address_us.rb +23 -5
- data/lib/ffaker/airline.rb +1 -1
- data/lib/ffaker/animal.rb +14 -0
- data/lib/ffaker/{animals.rb → animal_br.rb} +2 -2
- data/lib/ffaker/animal_cn.rb +12 -0
- data/lib/ffaker/animal_es.rb +12 -0
- data/lib/ffaker/animal_pl.rb +15 -0
- data/lib/ffaker/animal_us.rb +12 -0
- data/lib/ffaker/avatar.rb +32 -6
- data/lib/ffaker/aws.rb +1 -1
- data/lib/ffaker/bacon_ipsum.rb +1 -3
- data/lib/ffaker/bank.rb +118 -0
- data/lib/ffaker/bank_us.rb +33 -0
- data/lib/ffaker/book.rb +16 -8
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/cheesy_lingo.rb +5 -8
- data/lib/ffaker/code.rb +17 -1
- data/lib/ffaker/color.rb +7 -7
- data/lib/ffaker/color_pl.rb +14 -0
- data/lib/ffaker/color_ua.rb +1 -1
- data/lib/ffaker/company.rb +6 -9
- data/lib/ffaker/company_cn.rb +1 -1
- data/lib/ffaker/company_fr.rb +35 -0
- data/lib/ffaker/company_it.rb +4 -2
- data/lib/ffaker/company_ja.rb +24 -0
- data/lib/ffaker/company_se.rb +1 -1
- data/lib/ffaker/conference.rb +1 -1
- data/lib/ffaker/{courses.rb → courses_fr.rb} +3 -1
- data/lib/ffaker/crypto.rb +14 -0
- data/lib/ffaker/currency.rb +1 -1
- data/lib/ffaker/data/address/city_suffixes +1 -1
- data/lib/ffaker/data/address/country +1 -1
- data/lib/ffaker/data/address/country_code +1 -1
- data/lib/ffaker/data/address/neighborhood +1 -1
- data/lib/ffaker/data/address/street_suffix +1 -1
- data/lib/ffaker/data/address_br/city +0 -1
- data/lib/ffaker/data/address_br/complement +3 -0
- data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
- data/lib/ffaker/data/address_br/state +1 -1
- data/lib/ffaker/data/address_ca/city +99 -99
- data/lib/ffaker/data/address_ca/province +1 -1
- data/lib/ffaker/data/address_de/city +1 -1
- data/lib/ffaker/data/address_de/state +2 -1
- data/lib/ffaker/data/address_fr/city +1 -1
- data/lib/ffaker/data/address_fr/region +27 -0
- data/lib/ffaker/data/address_gr/city +1 -1
- data/lib/ffaker/data/address_gr/region +1 -1
- data/lib/ffaker/data/address_gr/street +1 -1
- data/lib/ffaker/data/address_in/city +24 -0
- data/lib/ffaker/data/address_it/city +111 -0
- data/lib/ffaker/data/address_it/region +20 -0
- data/lib/ffaker/data/address_ja/city +0 -23
- data/lib/ffaker/data/address_mx/ags +11 -0
- data/lib/ffaker/data/address_mx/bc +5 -0
- data/lib/ffaker/data/address_mx/bcs +5 -0
- data/lib/ffaker/data/address_mx/camp +11 -0
- data/lib/ffaker/data/address_mx/chih +67 -0
- data/lib/ffaker/data/address_mx/chis +118 -0
- data/lib/ffaker/data/address_mx/coah +38 -0
- data/lib/ffaker/data/address_mx/col +10 -0
- data/lib/ffaker/data/address_mx/df +16 -0
- data/lib/ffaker/data/address_mx/dgo +39 -0
- data/lib/ffaker/data/address_mx/gro +81 -0
- data/lib/ffaker/data/address_mx/gto +46 -0
- data/lib/ffaker/data/address_mx/hgo +84 -0
- data/lib/ffaker/data/address_mx/jal +125 -0
- data/lib/ffaker/data/address_mx/mex +125 -0
- data/lib/ffaker/data/address_mx/mich +113 -0
- data/lib/ffaker/data/address_mx/mor +33 -0
- data/lib/ffaker/data/address_mx/nay +20 -0
- data/lib/ffaker/data/address_mx/nl +51 -0
- data/lib/ffaker/data/address_mx/oax +570 -0
- data/lib/ffaker/data/address_mx/pue +217 -0
- data/lib/ffaker/data/address_mx/qr +10 -0
- data/lib/ffaker/data/address_mx/qro +18 -0
- data/lib/ffaker/data/address_mx/sin +18 -0
- data/lib/ffaker/data/address_mx/slp +58 -0
- data/lib/ffaker/data/address_mx/son +72 -0
- data/lib/ffaker/data/address_mx/state +1 -1
- data/lib/ffaker/data/address_mx/state_abbr +1 -1
- data/lib/ffaker/data/address_mx/tab +17 -0
- data/lib/ffaker/data/address_mx/tamps +43 -0
- data/lib/ffaker/data/address_mx/tlax +60 -0
- data/lib/ffaker/data/address_mx/ver +212 -0
- data/lib/ffaker/data/address_mx/yuc +106 -0
- data/lib/ffaker/data/address_mx/zac +58 -0
- data/lib/ffaker/data/address_ru/city +1 -1
- data/lib/ffaker/data/address_se/city +1 -1
- data/lib/ffaker/data/address_se/countries +1 -1
- data/lib/ffaker/data/address_se/street +1 -1
- data/lib/ffaker/data/address_sn/arrondissements +1 -1
- data/lib/ffaker/data/address_sn/departements +1 -1
- data/lib/ffaker/data/address_sn/regions +1 -1
- data/lib/ffaker/data/address_uk/county +1 -1
- data/lib/ffaker/data/address_us/state +1 -1
- data/lib/ffaker/data/address_us/state_abbr +1 -2
- data/lib/ffaker/data/address_us/state_and_territories_abbr +1 -1
- data/lib/ffaker/data/animal_br/common_names +423 -0
- data/lib/ffaker/data/animal_cn/common_names +141 -0
- data/lib/ffaker/data/animal_es/common_names +135 -0
- data/lib/ffaker/data/animal_pl/common_names +256 -0
- data/lib/ffaker/data/animal_us/common_names +141 -0
- data/lib/ffaker/data/aws/ec2_reserved_instance_tenancy +1 -1
- data/lib/ffaker/data/aws/ec2_reserved_offering_type +1 -1
- data/lib/ffaker/data/aws/ec2_reserved_product_description +1 -1
- data/lib/ffaker/data/bank/card_types +12 -0
- data/lib/ffaker/data/book/nouns +2 -2
- data/lib/ffaker/data/cheesy_lingo/cheesy_phrases +1 -1
- data/lib/ffaker/data/cheesy_lingo/cheesy_words +1 -1
- data/lib/ffaker/data/color/names_list +1 -1
- data/lib/ffaker/data/color_pl/names_list +122 -0
- data/lib/ffaker/data/company/bs_mid +1 -1
- data/lib/ffaker/data/company/bs_pos +1 -1
- data/lib/ffaker/data/company/bs_pre +1 -1
- data/lib/ffaker/data/company/catch_mid +1 -1
- data/lib/ffaker/data/company/catch_pos +1 -1
- data/lib/ffaker/data/company/catch_pre +1 -1
- data/lib/ffaker/data/company/position_areas +1 -1
- data/lib/ffaker/data/conference/conference_list +1 -1
- data/lib/ffaker/data/currency/currency_code +1 -1
- data/lib/ffaker/data/currency/currency_name +1 -1
- data/lib/ffaker/data/currency/currency_symbol +0 -1
- data/lib/ffaker/data/dizzle_ipsum/dizzle_words +1 -1
- data/lib/ffaker/data/education/major_noun +1 -1
- data/lib/ffaker/data/education/school_suffix +1 -1
- data/lib/ffaker/data/education_cn/city +351 -0
- data/lib/ffaker/data/education_cn/major +506 -0
- data/lib/ffaker/data/education_cn/province +31 -0
- data/lib/ffaker/data/education_cn/school_type +27 -0
- data/lib/ffaker/data/filesystem/extension +31 -31
- data/lib/ffaker/data/food/fruit +1 -1
- data/lib/ffaker/data/food/herb_spice +1 -1
- data/lib/ffaker/data/food/meat +1 -1
- data/lib/ffaker/data/food/vegetable +1 -1
- data/lib/ffaker/data/food_pl/diary +14 -0
- data/lib/ffaker/data/food_pl/fermented +13 -0
- data/lib/ffaker/data/food_pl/fruits +34 -0
- data/lib/ffaker/data/food_pl/herbs +20 -0
- data/lib/ffaker/data/food_pl/meats +9 -0
- data/lib/ffaker/data/food_pl/preserves +10 -0
- data/lib/ffaker/data/food_pl/spices +26 -0
- data/lib/ffaker/data/food_pl/vegetables +45 -0
- data/lib/ffaker/data/freedom_ipsum/freedom_words +161 -0
- data/lib/ffaker/data/game/adj_and_adv +18 -0
- data/lib/ffaker/data/game/category +84 -0
- data/lib/ffaker/data/game/mechanic +182 -0
- data/lib/ffaker/data/game/nouns +37 -0
- data/lib/ffaker/data/game/prefixes +17 -0
- data/lib/ffaker/data/healthcare_ru/doctor_specialization +127 -0
- data/lib/ffaker/data/hipster_ipsum/hipster_words +1 -1
- data/lib/ffaker/data/identification_mx/estados_curp +1 -1
- data/lib/ffaker/data/jo_jo/first_names +356 -0
- data/lib/ffaker/data/jo_jo/full_names +225 -0
- data/lib/ffaker/data/jo_jo/last_names +153 -0
- data/lib/ffaker/data/jo_jo/stands +149 -0
- data/lib/ffaker/data/job/job_adj +1 -1
- data/lib/ffaker/data/job/job_noun +1 -1
- data/lib/ffaker/data/job/job_prefix +1 -1
- data/lib/ffaker/data/job_fr/job_prefixes +1 -1
- data/lib/ffaker/data/job_it/job_adj +37 -0
- data/lib/ffaker/data/job_it/job_noun +25 -0
- data/lib/ffaker/data/job_it/job_prefix +22 -0
- data/lib/ffaker/data/locale/language +1 -1
- data/lib/ffaker/data/locale/language_code +1 -1
- data/lib/ffaker/data/lorem/characters +1 -1
- data/lib/ffaker/data/lorem/words +1 -68
- data/lib/ffaker/data/lorem_ar/words +1 -1
- data/lib/ffaker/data/lorem_br/characters +36 -0
- data/lib/ffaker/data/lorem_br/words +183 -0
- data/lib/ffaker/data/lorem_cn/words +1 -1
- data/lib/ffaker/data/lorem_fr/words +1 -1
- data/lib/ffaker/data/lorem_it/words +321 -0
- data/lib/ffaker/data/movie/adj_and_adv +1 -1
- data/lib/ffaker/data/movie/nouns +3 -3
- data/lib/ffaker/data/movie/prefixes +1 -1
- data/lib/ffaker/data/name/first_names_female +0 -230
- data/lib/ffaker/data/name/first_names_male +0 -37
- data/lib/ffaker/data/name/last_names +1 -2
- data/lib/ffaker/data/name/pronouns +6 -0
- data/lib/ffaker/data/name_ar/first_names_female +1 -1
- data/lib/ffaker/data/name_ar/first_names_male +1 -1
- data/lib/ffaker/data/name_ar/last_names +1 -1
- data/lib/ffaker/data/name_cn/first_names +1 -1
- data/lib/ffaker/data/name_cn/last_names +1 -1
- data/lib/ffaker/data/name_cs/female_first_names +40 -0
- data/lib/ffaker/data/name_cs/female_last_names +50 -0
- data/lib/ffaker/data/name_cs/male_first_names +88 -0
- data/lib/ffaker/data/name_cs/male_last_names +49 -0
- data/lib/ffaker/data/name_cs/prefixes +4 -4
- data/lib/ffaker/data/name_de/first_names +1 -1
- data/lib/ffaker/data/name_de/last_names +1 -1
- data/lib/ffaker/data/name_fr/first_names +1 -1
- data/lib/ffaker/data/name_fr/last_names +1 -1
- data/lib/ffaker/data/name_ga/first_names_female +1 -1
- data/lib/ffaker/data/name_ga/first_names_male +287 -287
- data/lib/ffaker/data/name_gr/female_first_names +1 -1
- data/lib/ffaker/data/name_gr/female_last_names +1 -1
- data/lib/ffaker/data/name_gr/male_first_names +1 -1
- data/lib/ffaker/data/name_gr/male_last_names +1 -1
- data/lib/ffaker/data/name_in/first_names_female +100 -0
- data/lib/ffaker/data/name_in/first_names_male +100 -0
- data/lib/ffaker/data/name_in/last_names +100 -0
- data/lib/ffaker/data/name_it/first_names +1 -1
- data/lib/ffaker/data/name_it/last_names +1 -1
- data/lib/ffaker/data/name_ja/first_names +1 -1
- data/lib/ffaker/data/name_ja/last_names +1 -1
- data/lib/ffaker/data/name_kh/first_names +1 -1
- data/lib/ffaker/data/name_kh/nick_names +1 -1
- data/lib/ffaker/data/name_kr/first_names +1 -1
- data/lib/ffaker/data/name_kr/last_names +1 -1
- data/lib/ffaker/data/name_mx/female_first_names +1 -1
- data/lib/ffaker/data/name_mx/last_names +1 -1
- data/lib/ffaker/data/name_mx/male_first_names +1 -1
- data/lib/ffaker/data/name_ph/autochthonous_surnames +1 -1
- data/lib/ffaker/data/name_ph/spanish_surnames +1 -1
- data/lib/ffaker/data/name_ru/first_names_female +91 -0
- data/lib/ffaker/data/name_ru/first_names_male +172 -0
- data/lib/ffaker/data/name_ru/last_names_female +100 -0
- data/lib/ffaker/data/name_ru/last_names_male +100 -0
- data/lib/ffaker/data/name_ru/middle_names_female +65 -0
- data/lib/ffaker/data/name_ru/middle_names_male +73 -0
- data/lib/ffaker/data/name_se/first_names_female +1 -1
- data/lib/ffaker/data/name_se/first_names_male +1 -1
- data/lib/ffaker/data/name_se/last_names +1 -1
- data/lib/ffaker/data/name_sn/first_names_female +1 -1
- data/lib/ffaker/data/name_sn/first_names_male +1 -1
- data/lib/ffaker/data/name_sn/last_names +1 -1
- data/lib/ffaker/data/name_th/first_names +1 -1
- data/lib/ffaker/data/name_th/last_names +1 -1
- data/lib/ffaker/data/name_th/nick_names +1 -1
- data/lib/ffaker/data/name_tw/first_names +122 -0
- data/lib/ffaker/data/name_tw/last_names +100 -0
- data/lib/ffaker/data/nato_alphabet/alphabet_codes +26 -0
- data/lib/ffaker/data/nato_alphabet/numeric_codes +10 -0
- data/lib/ffaker/data/phone_number_ja/four_disit_area_codes +41 -0
- data/lib/ffaker/data/phone_number_ja/one_disit_area_codes +3 -0
- data/lib/ffaker/data/phone_number_ja/three_disit_area_codes +296 -0
- data/lib/ffaker/data/phone_number_ja/two_disit_area_codes +48 -0
- data/lib/ffaker/data/phone_number_nl/area_codes +142 -0
- data/lib/ffaker/data/phone_number_ru/home_phone_prefixes +107 -0
- data/lib/ffaker/data/phone_number_ru/mobile_phone_prefixes +61 -0
- data/lib/ffaker/data/phone_number_se/phone_prefix +1 -1
- data/lib/ffaker/data/phone_number_ua/home_phone_prefixes +29 -0
- data/lib/ffaker/data/phone_number_ua/mobile_phone_prefixes +11 -0
- data/lib/ffaker/data/product/adj +1 -1
- data/lib/ffaker/data/product/b1 +1 -1
- data/lib/ffaker/data/product/noun +4 -1
- data/lib/ffaker/data/skill/specialty_end +1 -1
- data/lib/ffaker/data/skill/specialty_start +1 -1
- data/lib/ffaker/data/skill/tech_skills +1 -1
- data/lib/ffaker/data/sport_pl/summer +53 -0
- data/lib/ffaker/data/sport_pl/winter +14 -0
- data/lib/ffaker/data/sport_ru/summer +68 -0
- data/lib/ffaker/data/sport_ru/winter +20 -0
- data/lib/ffaker/data/sport_us/names +67 -0
- data/lib/ffaker/data/vehicle/color_prefixes +25 -0
- data/lib/ffaker/data/vehicle/displacements_list +1 -1
- data/lib/ffaker/data/vehicle/fuel_types_list +1 -1
- data/lib/ffaker/data/vehicle/makes_list +1 -1
- data/lib/ffaker/data/vehicle/transmissions_list +1 -1
- data/lib/ffaker/data/vehicle/upholstery_list +1 -1
- data/lib/ffaker/data/venue/venue_list +1 -1
- data/lib/ffaker/date.rb +40 -0
- data/lib/ffaker/dizzle_ipsum.rb +1 -3
- data/lib/ffaker/education.rb +9 -10
- data/lib/ffaker/education_cn.rb +37 -0
- data/lib/ffaker/filesystem.rb +18 -8
- data/lib/ffaker/food.rb +2 -0
- data/lib/ffaker/food_pl.rb +65 -0
- data/lib/ffaker/freedom_ipsum.rb +20 -0
- data/lib/ffaker/game.rb +33 -0
- data/lib/ffaker/gender.rb +1 -1
- data/lib/ffaker/gender_br.rb +1 -1
- data/lib/ffaker/gender_cn.rb +1 -1
- data/lib/ffaker/gender_id.rb +0 -1
- data/lib/ffaker/gender_it.rb +17 -0
- data/lib/ffaker/gender_ja.rb +18 -0
- data/lib/ffaker/gender_jp.rb +11 -0
- data/lib/ffaker/gender_kr.rb +1 -1
- data/lib/ffaker/gender_pl.rb +19 -0
- data/lib/ffaker/gender_ru.rb +22 -0
- data/lib/ffaker/geolocation.rb +34 -24
- data/lib/ffaker/guid.rb +1 -1
- data/lib/ffaker/healthcare_ipsum.rb +1 -3
- data/lib/ffaker/healthcare_ru.rb +12 -0
- data/lib/ffaker/hipster_ipsum.rb +1 -3
- data/lib/ffaker/html_ipsum.rb +10 -4
- data/lib/ffaker/identification.rb +5 -2
- data/lib/ffaker/identification_br.rb +4 -13
- data/lib/ffaker/identification_ec.rb +39 -0
- data/lib/ffaker/identification_es.rb +1 -1
- data/lib/ffaker/identification_es_cl.rb +7 -6
- data/lib/ffaker/identification_es_co.rb +3 -4
- data/lib/ffaker/identification_in.rb +15 -0
- data/lib/ffaker/identification_it.rb +30 -0
- data/lib/ffaker/identification_kr.rb +13 -6
- data/lib/ffaker/identification_mx.rb +14 -20
- data/lib/ffaker/identification_pl.rb +77 -0
- data/lib/ffaker/identification_tw.rb +24 -0
- data/lib/ffaker/image.rb +37 -14
- data/lib/ffaker/internet.rb +18 -25
- data/lib/ffaker/internet_se.rb +8 -10
- data/lib/ffaker/jo_jo.rb +24 -0
- data/lib/ffaker/job.rb +1 -1
- data/lib/ffaker/job_br.rb +1 -1
- data/lib/ffaker/job_cn.rb +1 -1
- data/lib/ffaker/job_fr.rb +1 -1
- data/lib/ffaker/job_it.rb +12 -0
- data/lib/ffaker/job_ja.rb +0 -1
- data/lib/ffaker/job_kr.rb +1 -1
- data/lib/ffaker/job_vn.rb +0 -1
- data/lib/ffaker/locale.rb +8 -12
- data/lib/ffaker/lorem.rb +6 -7
- data/lib/ffaker/lorem_ar.rb +1 -1
- data/lib/ffaker/lorem_br.rb +45 -0
- data/lib/ffaker/lorem_cn.rb +1 -2
- data/lib/ffaker/lorem_fr.rb +1 -1
- data/lib/ffaker/lorem_ie.rb +0 -1
- data/lib/ffaker/lorem_it.rb +39 -0
- data/lib/ffaker/lorem_ja.rb +2 -2
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/lorem_pl.rb +0 -2
- data/lib/ffaker/lorem_ru.rb +1 -2
- data/lib/ffaker/lorem_ua.rb +3 -5
- data/lib/ffaker/movie.rb +8 -5
- data/lib/ffaker/music.rb +1 -1
- data/lib/ffaker/name.rb +5 -1
- data/lib/ffaker/name_ar.rb +0 -1
- data/lib/ffaker/name_br.rb +1 -1
- data/lib/ffaker/name_cn.rb +1 -1
- data/lib/ffaker/name_cs.rb +7 -9
- data/lib/ffaker/name_da.rb +2 -4
- data/lib/ffaker/name_de.rb +1 -3
- data/lib/ffaker/name_es.rb +0 -2
- data/lib/ffaker/name_fr.rb +5 -5
- data/lib/ffaker/name_ga.rb +1 -1
- data/lib/ffaker/name_gr.rb +2 -3
- data/lib/ffaker/name_id.rb +0 -1
- data/lib/ffaker/name_in.rb +39 -0
- data/lib/ffaker/name_it.rb +2 -3
- data/lib/ffaker/name_ja.rb +1 -1
- data/lib/ffaker/name_kh.rb +2 -0
- data/lib/ffaker/name_kr.rb +1 -1
- data/lib/ffaker/name_mx.rb +4 -6
- data/lib/ffaker/name_nb.rb +1 -3
- data/lib/ffaker/name_nl.rb +1 -3
- data/lib/ffaker/name_ph.rb +1 -3
- data/lib/ffaker/name_pl.rb +2 -3
- data/lib/ffaker/name_ru.rb +32 -71
- data/lib/ffaker/name_se.rb +1 -3
- data/lib/ffaker/name_sn.rb +3 -6
- data/lib/ffaker/name_th.rb +1 -1
- data/lib/ffaker/name_th_en.rb +2 -2
- data/lib/ffaker/name_tw.rb +20 -0
- data/lib/ffaker/name_ua.rb +1 -3
- data/lib/ffaker/name_vn.rb +1 -1
- data/lib/ffaker/nato_alphabet.rb +2 -4
- data/lib/ffaker/number.rb +30 -0
- data/lib/ffaker/phone_number.rb +1 -1
- data/lib/ffaker/phone_number_au.rb +11 -12
- data/lib/ffaker/phone_number_br.rb +16 -14
- data/lib/ffaker/phone_number_ch.rb +1 -1
- data/lib/ffaker/phone_number_cu.rb +18 -27
- data/lib/ffaker/phone_number_da.rb +1 -3
- data/lib/ffaker/phone_number_de.rb +4 -5
- data/lib/ffaker/phone_number_fr.rb +3 -12
- data/lib/ffaker/phone_number_id.rb +2 -6
- data/lib/ffaker/phone_number_it.rb +9 -7
- data/lib/ffaker/phone_number_ja.rb +88 -0
- data/lib/ffaker/phone_number_kr.rb +1 -1
- data/lib/ffaker/phone_number_mx.rb +1 -2
- data/lib/ffaker/phone_number_nl.rb +9 -12
- data/lib/ffaker/phone_number_pl.rb +68 -0
- data/lib/ffaker/phone_number_ru.rb +120 -0
- data/lib/ffaker/phone_number_se.rb +1 -1
- data/lib/ffaker/phone_number_sg.rb +1 -1
- data/lib/ffaker/phone_number_sn.rb +12 -19
- data/lib/ffaker/phone_number_tw.rb +49 -0
- data/lib/ffaker/phone_number_ua.rb +42 -0
- data/lib/ffaker/product.rb +10 -12
- data/lib/ffaker/sem_ver.rb +19 -0
- data/lib/ffaker/skill.rb +2 -2
- data/lib/ffaker/sport.rb +4 -0
- data/lib/ffaker/sport_pl.rb +25 -0
- data/lib/ffaker/sport_ru.rb +25 -0
- data/lib/ffaker/sport_us.rb +12 -0
- data/lib/ffaker/ssn.rb +5 -5
- data/lib/ffaker/ssn_mx.rb +1 -2
- data/lib/ffaker/ssn_se.rb +16 -44
- data/lib/ffaker/string.rb +18 -17
- data/lib/ffaker/time.rb +12 -11
- data/lib/ffaker/tweet.rb +4 -4
- data/lib/ffaker/unit.rb +10 -11
- data/lib/ffaker/unit_english.rb +19 -22
- data/lib/ffaker/unit_metric.rb +16 -19
- data/lib/ffaker/utils/array_utils.rb +8 -5
- data/lib/ffaker/utils/module_utils.rb +27 -6
- data/lib/ffaker/utils/random_utils.rb +4 -0
- data/lib/ffaker/utils/unique_utils.rb +32 -21
- data/lib/ffaker/vehicle.rb +67 -9
- data/lib/ffaker/venue.rb +1 -1
- data/lib/ffaker/version.rb +5 -0
- data/lib/ffaker/youtube.rb +1 -1
- data/lib/ffaker.rb +74 -164
- data/scripts/benchmark.rb +12 -11
- data/scripts/profiling.rb +3 -1
- data/scripts/reference.rb +26 -24
- data/test/helper.rb +41 -6
- data/test/test_address.rb +2 -2
- data/test/test_address_au.rb +7 -8
- data/test/test_address_br.rb +17 -4
- data/test/test_address_ca.rb +2 -2
- data/test/test_address_ch.rb +2 -2
- data/test/test_address_ch_de.rb +2 -2
- data/test/test_address_ch_fr.rb +2 -2
- data/test/test_address_ch_it.rb +2 -2
- data/test/test_address_da.rb +5 -5
- data/test/test_address_de.rb +2 -2
- data/test/test_address_fi.rb +4 -5
- data/test/test_address_fr.rb +3 -4
- data/test/test_address_gr.rb +2 -2
- data/test/test_address_id.rb +2 -3
- data/test/test_address_in.rb +2 -2
- data/test/test_address_it.rb +12 -0
- data/test/test_address_ja.rb +2 -3
- data/test/test_address_kr.rb +1 -2
- data/test/test_address_mx.rb +2 -3
- data/test/test_address_nl.rb +3 -3
- data/test/test_address_pl.rb +1 -2
- data/test/test_address_ru.rb +2 -2
- data/test/test_address_se.rb +4 -4
- data/test/test_address_sn.rb +2 -5
- data/test/test_address_ua.rb +2 -2
- data/test/test_address_uk.rb +2 -2
- data/test/test_address_us.rb +11 -2
- data/test/test_airline.rb +2 -2
- data/test/test_animal.rb +2 -2
- data/test/test_animal_br.rb +17 -0
- data/test/test_animal_cn.rb +17 -0
- data/test/test_animal_es.rb +17 -0
- data/test/test_animal_pl.rb +17 -0
- data/test/test_animal_us.rb +17 -0
- data/test/test_array_utils.rb +3 -3
- data/test/test_avatar.rb +35 -10
- data/test/test_aws.rb +3 -3
- data/test/test_bacon_ipsum.rb +2 -2
- data/test/test_bank.rb +53 -0
- data/test/test_bank_us.rb +35 -0
- data/test/test_book.rb +35 -6
- data/test/test_boolean.rb +3 -3
- data/test/test_cheesy_lingo.rb +4 -2
- data/test/test_code.rb +23 -3
- data/test/test_color.rb +2 -2
- data/test/test_color_pl.rb +13 -0
- data/test/test_color_ua.rb +2 -2
- data/test/test_company.rb +4 -4
- data/test/test_company_cn.rb +2 -2
- data/test/test_company_fr.rb +33 -0
- data/test/test_company_it.rb +2 -2
- data/test/test_company_ja.rb +28 -0
- data/test/test_company_se.rb +2 -2
- data/test/test_conference.rb +2 -2
- data/test/test_course_mathematiques.rb +3 -1
- data/test/test_course_philosophie.rb +3 -1
- data/test/test_crypto.rb +15 -0
- data/test/test_currency.rb +2 -2
- data/test/test_date.rb +47 -0
- data/test/test_dizzle_ipsum.rb +2 -2
- data/test/test_education.rb +2 -2
- data/test/test_education_cn.rb +29 -0
- data/test/{test_faker.rb → test_ffaker.rb} +7 -3
- data/test/test_filesystem.rb +39 -5
- data/test/test_food.rb +3 -3
- data/test/test_food_pl.rb +61 -0
- data/test/test_freedom_ipsum.rb +21 -0
- data/test/test_game.rb +28 -0
- data/test/test_gender.rb +3 -3
- data/test/test_gender_br.rb +2 -2
- data/test/test_gender_cn.rb +2 -2
- data/test/test_gender_id.rb +1 -2
- data/test/test_gender_it.rb +27 -0
- data/test/test_gender_ja.rb +27 -0
- data/test/test_gender_jp.rb +27 -0
- data/test/test_gender_kr.rb +2 -2
- data/test/test_gender_pl.rb +27 -0
- data/test/test_gender_ru.rb +23 -0
- data/test/test_geolocation.rb +4 -4
- data/test/test_guid.rb +2 -2
- data/test/test_healthcare_ipsum.rb +3 -1
- data/test/test_healthcare_ru.rb +19 -0
- data/test/test_hipster_ipsum.rb +2 -2
- data/test/test_html_ipsum.rb +20 -14
- data/test/test_identification.rb +14 -4
- data/test/test_identification_br.rb +2 -2
- data/test/test_identification_co.rb +5 -3
- data/test/test_identification_ec.rb +33 -0
- data/test/test_identification_es.rb +2 -2
- data/test/test_identification_es_cl.rb +3 -3
- data/test/test_identification_es_mx.rb +5 -4
- data/test/test_identification_in.rb +20 -0
- data/test/test_identification_it.rb +45 -0
- data/test/test_identification_kr.rb +5 -5
- data/test/test_identification_pl.rb +28 -0
- data/test/test_identification_tw.rb +17 -0
- data/test/test_image.rb +56 -10
- data/test/test_internet.rb +18 -16
- data/test/test_internet_se.rb +12 -9
- data/test/test_jo_jo.rb +29 -0
- data/test/test_job.rb +2 -2
- data/test/test_job_br.rb +2 -2
- data/test/test_job_cn.rb +3 -3
- data/test/test_job_fr.rb +2 -2
- data/test/test_job_it.rb +17 -0
- data/test/test_job_ja.rb +3 -3
- data/test/test_job_kr.rb +3 -3
- data/test/test_job_vn.rb +2 -3
- data/test/test_locale.rb +2 -2
- data/test/test_lorem.rb +6 -2
- data/test/test_lorem_ar.rb +3 -4
- data/test/test_lorem_br.rb +62 -0
- data/test/test_lorem_cn.rb +11 -11
- data/test/test_lorem_fr.rb +14 -12
- data/test/test_lorem_ie.rb +1 -2
- data/test/test_lorem_it.rb +51 -0
- data/test/test_lorem_ja.rb +5 -5
- data/test/test_lorem_kr.rb +2 -2
- data/test/test_lorem_pl.rb +2 -3
- data/test/test_lorem_ru.rb +3 -4
- data/test/test_lorem_ua.rb +4 -4
- data/test/test_module_utils.rb +35 -2
- data/test/test_movie.rb +2 -2
- data/test/test_music.rb +6 -6
- data/test/test_name.rb +7 -3
- data/test/test_name_ar.rb +1 -2
- data/test/test_name_br.rb +2 -2
- data/test/test_name_cn.rb +2 -2
- data/test/test_name_cs.rb +3 -4
- data/test/test_name_da.rb +5 -5
- data/test/test_name_de.rb +2 -2
- data/test/test_name_es.rb +1 -2
- data/test/test_name_fr.rb +2 -3
- data/test/test_name_ga.rb +2 -2
- data/test/test_name_gr.rb +2 -2
- data/test/test_name_id.rb +1 -2
- data/test/test_name_it.rb +2 -3
- data/test/test_name_ja.rb +2 -2
- data/test/test_name_kh.rb +10 -8
- data/test/test_name_kr.rb +2 -2
- data/test/test_name_mx.rb +2 -3
- data/test/test_name_nb.rb +2 -2
- data/test/test_name_nl.rb +2 -2
- data/test/test_name_ph.rb +2 -2
- data/test/test_name_pl.rb +1 -2
- data/test/test_name_ru.rb +38 -48
- data/test/test_name_se.rb +2 -2
- data/test/test_name_sn.rb +2 -3
- data/test/test_name_th.rb +2 -2
- data/test/test_name_th_en.rb +2 -2
- data/test/test_name_tw.rb +28 -0
- data/test/test_name_ua.rb +3 -3
- data/test/test_name_vn.rb +2 -2
- data/test/test_nato_alphabet.rb +2 -2
- data/test/test_number.rb +57 -0
- data/test/test_phone_number.rb +3 -3
- data/test/test_phone_number_au.rb +5 -6
- data/test/test_phone_number_br.rb +12 -5
- data/test/test_phone_number_cu.rb +5 -12
- data/test/test_phone_number_da.rb +2 -3
- data/test/test_phone_number_de.rb +2 -3
- data/test/test_phone_number_fr.rb +1 -2
- data/test/test_phone_number_id.rb +1 -2
- data/test/test_phone_number_it.rb +12 -0
- data/test/test_phone_number_ja.rb +63 -0
- data/test/test_phone_number_kr.rb +2 -2
- data/test/test_phone_number_mx.rb +2 -3
- data/test/test_phone_number_nl.rb +3 -4
- data/test/test_phone_number_pl.rb +56 -0
- data/test/test_phone_number_ru.rb +76 -0
- data/test/test_phone_number_se.rb +4 -4
- data/test/test_phone_number_sg.rb +10 -10
- data/test/test_phone_number_sn.rb +4 -5
- data/test/test_phone_number_tw.rb +42 -0
- data/test/test_phone_number_ua.rb +38 -0
- data/test/test_products.rb +2 -2
- data/test/test_sem_ver.rb +18 -0
- data/test/test_skill.rb +2 -2
- data/test/test_sport_pl.rb +30 -0
- data/test/test_sport_ru.rb +30 -0
- data/test/test_sport_us.rb +17 -0
- data/test/test_sports.rb +2 -2
- data/test/test_ssn.rb +2 -2
- data/test/test_ssn_mx.rb +2 -3
- data/test/test_ssn_se.rb +10 -12
- data/test/test_string.rb +8 -8
- data/test/test_time.rb +14 -8
- data/test/test_tweet.rb +11 -11
- data/test/test_unique_utils.rb +31 -7
- data/test/test_units.rb +9 -9
- data/test/test_units_english.rb +17 -18
- data/test/test_units_metric.rb +17 -18
- data/test/test_vehicle.rb +32 -5
- data/test/test_venue.rb +2 -2
- data/test/test_youtube.rb +2 -2
- metadata +211 -198
- data/lib/ffaker/data/address_jp/city +0 -127
- data/lib/ffaker/data/address_jp/designated_city +0 -20
- data/lib/ffaker/data/address_jp/street +0 -37
- data/lib/ffaker/data/address_jp/tokyo_ward +0 -23
- data/lib/ffaker/data/address_jp/village +0 -183
- data/lib/ffaker/data/address_jp/ward +0 -188
data/test/test_image.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestImage < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
7
7
|
|
8
|
-
PLACEHOLDER = 'https://
|
8
|
+
PLACEHOLDER = 'https://dummyimage.com/'
|
9
9
|
|
10
10
|
assert_methods_are_deterministic(FFaker::Image, :url)
|
11
11
|
|
@@ -14,38 +14,84 @@ class TestImage < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_url
|
17
|
-
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}300x300
|
17
|
+
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}300x300/[0-9a-f]{6}/[0-9a-f]{6}\.png\?text=),
|
18
18
|
@tester.url)
|
19
19
|
end
|
20
20
|
|
21
|
+
def test_url_output_with_keyword_arguments
|
22
|
+
output = capture_output do
|
23
|
+
@tester.url(format: 'jpg')
|
24
|
+
end
|
25
|
+
|
26
|
+
assert_equal ['', ''], output
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_url_with_size_as_positional_argument
|
30
|
+
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}150x320/[0-9a-f]{6}/[0-9a-f]{6}\.png\?text=), @tester.url('150x320'))
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_url_output_with_positional_arguments
|
34
|
+
output = capture_output do
|
35
|
+
@tester.url('150x320')
|
36
|
+
end
|
37
|
+
|
38
|
+
assert_equal(
|
39
|
+
['', "Positional arguments for Image#url are deprecated. Please use keyword arguments.\n"],
|
40
|
+
output
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
21
44
|
def test_image_url_with_param
|
22
45
|
assert_equal("#{PLACEHOLDER}300x300//.png?text=",
|
23
|
-
@tester.url('300x300', 'png', nil, nil))
|
46
|
+
@tester.url(size: '300x300', format: 'png', bg_color: nil, text_color: nil))
|
24
47
|
end
|
25
48
|
|
26
49
|
def test_image_url_with_correct_size
|
27
|
-
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}150x320
|
28
|
-
@tester.url('150x320'))
|
50
|
+
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}150x320/[0-9a-f]{6}/[0-9a-f]{6}\.png\?text=),
|
51
|
+
@tester.url(size: '150x320'))
|
29
52
|
end
|
30
53
|
|
31
54
|
def test_image_url_with_incorrect_size
|
32
55
|
assert_raise ArgumentError do
|
33
|
-
@tester.url('150x320z')
|
56
|
+
@tester.url(size: '150x320z')
|
34
57
|
end
|
35
58
|
end
|
36
59
|
|
37
60
|
def test_image_url_with_supported_format
|
38
|
-
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}300x300
|
39
|
-
@tester.url('300x300', 'jpg'))
|
61
|
+
assert_match(%r(#{Regexp.quote(PLACEHOLDER)}300x300/[0-9a-f]{6}/[0-9a-f]{6}\.jpg\?text=),
|
62
|
+
@tester.url(size: '300x300', format: 'jpg'))
|
40
63
|
end
|
41
64
|
|
42
65
|
def test_image_url_with_incorrect_format
|
43
66
|
assert_raise ArgumentError do
|
44
|
-
@tester.url('300x300', 'wrong_format')
|
67
|
+
@tester.url(size: '300x300', format: 'wrong_format')
|
45
68
|
end
|
46
69
|
end
|
47
70
|
|
48
71
|
def test_image_file
|
49
72
|
assert_equal(@tester.file.class.name, 'File')
|
50
73
|
end
|
74
|
+
|
75
|
+
def test_file_output_with_keyword_arguments
|
76
|
+
output = capture_output do
|
77
|
+
@tester.file(format: 'jpg')
|
78
|
+
end
|
79
|
+
|
80
|
+
assert_equal ['', ''], output
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_file_with_size_as_positional_argument
|
84
|
+
assert_equal(@tester.file('150x320').class.name, 'File')
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_file_output_with_positional_arguments
|
88
|
+
output = capture_output do
|
89
|
+
@tester.file('150x320')
|
90
|
+
end
|
91
|
+
|
92
|
+
assert_equal(
|
93
|
+
['', "Positional arguments for Image#file are deprecated. Please use keyword arguments.\n"],
|
94
|
+
output
|
95
|
+
)
|
96
|
+
end
|
51
97
|
end
|
data/test/test_internet.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestFakerInternet < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -29,7 +29,9 @@ class TestFakerInternet < Test::Unit::TestCase
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_disposable_email
|
32
|
-
assert @tester.disposable_email.match(
|
32
|
+
assert @tester.disposable_email.match(
|
33
|
+
/.+@(mailinator\.com|suremail\.info|spamherelots\.com|binkmail\.com|safetymail\.info)/
|
34
|
+
)
|
33
35
|
end
|
34
36
|
|
35
37
|
def test_safe_email
|
@@ -57,9 +59,9 @@ class TestFakerInternet < Test::Unit::TestCase
|
|
57
59
|
end
|
58
60
|
|
59
61
|
def test_uri
|
60
|
-
assert @tester.uri('ftp').match(
|
61
|
-
assert @tester.uri('http').match(
|
62
|
-
assert @tester.uri('https').match(
|
62
|
+
assert @tester.uri('ftp').match(%r{^ftp://.+})
|
63
|
+
assert @tester.uri('http').match(%r{^http://.+})
|
64
|
+
assert @tester.uri('https').match(%r{^https://.+})
|
63
65
|
|
64
66
|
assert_deterministic { @tester.uri('ftp') }
|
65
67
|
assert_deterministic { @tester.uri('http') }
|
@@ -67,7 +69,7 @@ class TestFakerInternet < Test::Unit::TestCase
|
|
67
69
|
end
|
68
70
|
|
69
71
|
def test_http_url
|
70
|
-
assert @tester.http_url.match(
|
72
|
+
assert @tester.http_url.match(%r{^http://.+})
|
71
73
|
end
|
72
74
|
|
73
75
|
def test_ip_v4_address
|
@@ -93,15 +95,15 @@ class TestFakerInternet < Test::Unit::TestCase
|
|
93
95
|
end
|
94
96
|
|
95
97
|
def test_password_min_length
|
96
|
-
|
97
|
-
|
98
|
-
|
98
|
+
assert_greater_than @tester.password(3).length, 2
|
99
|
+
assert_greater_than @tester.password(6).length, 5
|
100
|
+
assert_greater_than @tester.password(15).length, 14
|
99
101
|
end
|
100
102
|
|
101
103
|
def test_password_max_length
|
102
|
-
|
103
|
-
|
104
|
-
|
104
|
+
assert_less_than @tester.password(3, 10).length, 11
|
105
|
+
assert_less_than @tester.password(7, 15).length, 16
|
106
|
+
assert_less_than @tester.password(1, 3).length, 4
|
105
107
|
end
|
106
108
|
|
107
109
|
def test_password_fixed_length
|
@@ -109,9 +111,9 @@ class TestFakerInternet < Test::Unit::TestCase
|
|
109
111
|
end
|
110
112
|
|
111
113
|
def test_password_strange_argument
|
112
|
-
|
113
|
-
|
114
|
-
|
114
|
+
assert_greater_than @tester.password(10, 2).length, 9
|
115
|
+
assert_greater_than @tester.password(3, 1).length, 2
|
116
|
+
assert_greater_than @tester.password(8, 5).length, 7
|
115
117
|
end
|
116
118
|
|
117
119
|
def test_mac
|
data/test/test_internet_se.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestFakerInternetSE < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -25,12 +25,15 @@ class TestFakerInternetSE < Test::Unit::TestCase
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_disposable_email
|
28
|
-
assert @tester.disposable_email.match(
|
28
|
+
assert @tester.disposable_email.match(
|
29
|
+
/.+@(mailinator\.com|suremail\.info|spamherelots\.com|binkmail\.com|safetymail\.info)/
|
30
|
+
)
|
29
31
|
end
|
30
32
|
|
31
33
|
def test_free_email
|
32
34
|
email = @tester.free_email
|
33
|
-
assert email.match(/.+@(gmail\.com|hotmail\.com|yahoo\.com|spray\.se|passagen\.se)/),
|
35
|
+
assert email.match(/.+@(gmail\.com|hotmail\.com|yahoo\.com|spray\.se|passagen\.se)/),
|
36
|
+
"mail: #{email} does not match"
|
34
37
|
end
|
35
38
|
|
36
39
|
def test_login_user_name
|
@@ -59,13 +62,13 @@ class TestFakerInternetSE < Test::Unit::TestCase
|
|
59
62
|
end
|
60
63
|
|
61
64
|
def test_uri
|
62
|
-
assert @tester.uri('ftp').match(
|
63
|
-
assert @tester.uri('http').match(
|
64
|
-
assert @tester.uri('https').match(
|
65
|
+
assert @tester.uri('ftp').match(%r{^ftp://.+})
|
66
|
+
assert @tester.uri('http').match(%r{^http://.+})
|
67
|
+
assert @tester.uri('https').match(%r{^https://.+})
|
65
68
|
end
|
66
69
|
|
67
70
|
def test_http_url
|
68
|
-
assert @tester.http_url.match(
|
71
|
+
assert @tester.http_url.match(%r{^http://.+})
|
69
72
|
end
|
70
73
|
|
71
74
|
def test_ip_v4_address
|
@@ -73,6 +76,6 @@ class TestFakerInternetSE < Test::Unit::TestCase
|
|
73
76
|
end
|
74
77
|
|
75
78
|
def test_slug
|
76
|
-
assert @tester.slug.match(/^[a-z]+(_
|
79
|
+
assert @tester.slug.match(/^[a-z]+(_|\.|-)[a-z]+$/)
|
77
80
|
end
|
78
81
|
end
|
data/test/test_jo_jo.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'helper'
|
4
|
+
|
5
|
+
class TestJoJo < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(FFaker::JoJo, :full_name, :first_name, :last_name, :stand)
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@tester = FFaker::JoJo
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_full_name
|
15
|
+
assert_include @tester::FULL_NAMES, @tester.full_name
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_first_name
|
19
|
+
assert_include @tester::FIRST_NAMES, @tester.first_name
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_last_name
|
23
|
+
assert_include @tester::LAST_NAMES, @tester.last_name
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_stand
|
27
|
+
assert_include @tester::STANDS, @tester.stand
|
28
|
+
end
|
29
|
+
end
|
data/test/test_job.rb
CHANGED
data/test/test_job_br.rb
CHANGED
data/test/test_job_cn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestFakerJobCN < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -12,7 +12,7 @@ class TestFakerJobCN < Test::Unit::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_title
|
15
|
-
|
15
|
+
assert_greater_than_or_equal_to @tester.title.length, 1
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_nouns
|
data/test/test_job_fr.rb
CHANGED
data/test/test_job_it.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'helper'
|
4
|
+
|
5
|
+
class TestFakerJobIT < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(FFaker::JobIT, :title)
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@tester = FFaker::JobIT
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_title
|
15
|
+
assert_match(/\A(\w+\.? ?){2,3}\z/, @tester.title)
|
16
|
+
end
|
17
|
+
end
|
data/test/test_job_ja.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestFakerJobJA < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -12,7 +12,7 @@ class TestFakerJobJA < Test::Unit::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_title
|
15
|
-
|
15
|
+
assert_greater_than_or_equal_to @tester.title.length, 1
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_nouns
|
data/test/test_job_kr.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestFakerJobKR < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -12,7 +12,7 @@ class TestFakerJobKR < Test::Unit::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_title
|
15
|
-
|
15
|
+
assert_greater_than_or_equal_to @tester.title.length, 1
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_nouns
|
data/test/test_job_vn.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# encoding: UTF-8
|
3
2
|
|
4
|
-
|
3
|
+
require_relative 'helper'
|
5
4
|
|
6
5
|
class TestFakerJobVN < Test::Unit::TestCase
|
7
6
|
include DeterministicHelper
|
@@ -13,7 +12,7 @@ class TestFakerJobVN < Test::Unit::TestCase
|
|
13
12
|
end
|
14
13
|
|
15
14
|
def test_title
|
16
|
-
|
15
|
+
assert_greater_than_or_equal_to @tester.title.length, 1
|
17
16
|
end
|
18
17
|
|
19
18
|
def test_nouns
|
data/test/test_locale.rb
CHANGED
data/test/test_lorem.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestLorem < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -51,4 +51,8 @@ class TestLorem < Test::Unit::TestCase
|
|
51
51
|
assert FFaker::Lorem.characters(10).length == 10
|
52
52
|
assert FFaker::Lorem.characters(-1) == ''
|
53
53
|
end
|
54
|
+
|
55
|
+
def test_word_collection_uniqueness
|
56
|
+
assert_equal(FFaker::Lorem::WORDS, FFaker::Lorem::WORDS.uniq)
|
57
|
+
end
|
54
58
|
end
|
data/test/test_lorem_ar.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestLoremARAR < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
7
7
|
|
8
8
|
assert_methods_are_deterministic(
|
9
9
|
FFaker::LoremAR,
|
10
|
-
:paragraph, :paragraphs, :sentence, :sentences,
|
11
|
-
:phrase, :phrases, :word, :words
|
10
|
+
:paragraph, :paragraphs, :sentence, :sentences, :phrase, :phrases, :word, :words
|
12
11
|
)
|
13
12
|
|
14
13
|
def test_paragraph
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'helper'
|
4
|
+
|
5
|
+
class TestLoremBR < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(
|
9
|
+
FFaker::LoremBR,
|
10
|
+
:paragraph, :sentence, :phrase, :paragraphs, :sentences, :phrases, :words, :word, :characters
|
11
|
+
)
|
12
|
+
|
13
|
+
CHARACTERS = /\A[A-zÀ-ü0-9]+\z/i
|
14
|
+
WORD = /\A[A-zÀ-ü-]+\z/i
|
15
|
+
WORDS = /[ A-zÀ-ü\-.]+/i
|
16
|
+
|
17
|
+
def test_paragraph
|
18
|
+
assert_match(WORDS, FFaker::LoremBR.paragraph)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_sentence
|
22
|
+
assert_match(WORDS, FFaker::LoremBR.sentence)
|
23
|
+
assert_nothing_thrown do
|
24
|
+
100.times { FFaker::LoremBR.sentence 0 }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_phrase
|
29
|
+
assert_match(WORDS, FFaker::LoremBR.phrase)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_paragraphs
|
33
|
+
assert_match(WORDS, FFaker::LoremBR.paragraphs.join(' '))
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_sentences
|
37
|
+
assert_match(WORDS, FFaker::LoremBR.sentences.join(' '))
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_phrases
|
41
|
+
assert_match(WORDS, FFaker::LoremBR.phrases.join(' '))
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_words
|
45
|
+
assert_match(WORDS, FFaker::LoremBR.words.join(' '))
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_word
|
49
|
+
assert_match(WORD, FFaker::LoremBR.word)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_characters
|
53
|
+
assert_match(CHARACTERS, FFaker::LoremBR.characters)
|
54
|
+
assert FFaker::LoremBR.characters.length == 255
|
55
|
+
assert FFaker::LoremBR.characters(10).length == 10
|
56
|
+
assert FFaker::LoremBR.characters(-1) == ''
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_word_collection_uniqueness
|
60
|
+
assert_equal(FFaker::Lorem::WORDS, FFaker::Lorem::WORDS.uniq)
|
61
|
+
end
|
62
|
+
end
|
data/test/test_lorem_cn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestLoremCN < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
@@ -11,15 +11,15 @@ class TestLoremCN < Test::Unit::TestCase
|
|
11
11
|
)
|
12
12
|
|
13
13
|
def test_paragraph
|
14
|
-
|
14
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.paragraph.length, 3 * 4 * 2
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_sentence
|
18
|
-
|
18
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.sentence.length, 4 * 2
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_paragraphs
|
22
|
-
|
22
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.paragraphs.length, 2
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_paragraphs_is_not_a_string_representation_of_an_array
|
@@ -27,28 +27,28 @@ class TestLoremCN < Test::Unit::TestCase
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_paragraphs_is_an_array
|
30
|
-
assert FFaker::LoremCN.paragraphs.
|
30
|
+
assert FFaker::LoremCN.paragraphs.instance_of?(Array)
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_sentences
|
34
|
-
|
34
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.sentences.length, 2
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_sentences_is_an_array
|
38
|
-
assert FFaker::LoremCN.sentences.
|
38
|
+
assert FFaker::LoremCN.sentences.instance_of?(Array)
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_sentences_via_to_s_produces_string_terminated_with_period
|
42
42
|
string = FFaker::LoremCN.sentences.to_s
|
43
|
-
assert string.
|
43
|
+
assert string.instance_of?(String)
|
44
44
|
assert string =~ /。$/
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_words
|
48
|
-
|
48
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.words.length, 2
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_word
|
52
|
-
|
52
|
+
assert_greater_than_or_equal_to FFaker::LoremCN.word.length, 1
|
53
53
|
end
|
54
54
|
end
|
data/test/test_lorem_fr.rb
CHANGED
@@ -1,46 +1,48 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'helper'
|
4
4
|
|
5
5
|
class TestLoremFR < Test::Unit::TestCase
|
6
6
|
include DeterministicHelper
|
7
7
|
|
8
8
|
assert_methods_are_deterministic(
|
9
9
|
FFaker::LoremFR,
|
10
|
-
:paragraph, :paragraphs, :sentence, :sentences,
|
11
|
-
:phrase, :phrases, :word, :words
|
10
|
+
:paragraph, :paragraphs, :sentence, :sentences, :phrase, :phrases, :word, :words
|
12
11
|
)
|
12
|
+
|
13
13
|
REGEX = /\A[ -.ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i
|
14
|
+
REGEX_WORD = /\A[-ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i
|
15
|
+
REGEX_WORDS = /\A[ -ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i
|
14
16
|
|
15
17
|
def test_paragraph
|
16
|
-
assert_match(
|
18
|
+
assert_match(REGEX, FFaker::LoremFR.paragraph)
|
17
19
|
end
|
18
20
|
|
19
21
|
def test_sentence
|
20
|
-
assert_match(
|
22
|
+
assert_match(REGEX, FFaker::LoremFR.sentence)
|
21
23
|
end
|
22
24
|
|
23
25
|
def test_phrase
|
24
|
-
assert_match(
|
26
|
+
assert_match(REGEX, FFaker::LoremFR.phrase)
|
25
27
|
end
|
26
28
|
|
27
|
-
def
|
29
|
+
def test_paragraphs
|
28
30
|
assert_match(REGEX, FFaker::LoremFR.paragraphs.join(' '))
|
29
31
|
end
|
30
32
|
|
31
33
|
def test_sentences
|
32
|
-
assert_match(
|
34
|
+
assert_match(REGEX, FFaker::LoremFR.sentences.join(' '))
|
33
35
|
end
|
34
36
|
|
35
37
|
def test_phrases
|
36
|
-
assert_match(
|
38
|
+
assert_match(REGEX, FFaker::LoremFR.phrases.join(' '))
|
37
39
|
end
|
38
40
|
|
39
41
|
def test_words
|
40
|
-
assert_match(
|
42
|
+
assert_match(REGEX_WORDS, FFaker::LoremFR.words.join(' '))
|
41
43
|
end
|
42
44
|
|
43
45
|
def test_word
|
44
|
-
assert_match(
|
46
|
+
assert_match(REGEX_WORD, FFaker::LoremFR.word)
|
45
47
|
end
|
46
48
|
end
|