Skip to content

Commit

Permalink
add only japanese word spec
Browse files Browse the repository at this point in the history
  • Loading branch information
4geru committed Sep 17, 2019
1 parent 839bfed commit 5739c85
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ja:
- "#{city_prefix}#{Name.last_name}#{city_suffix}"
- "#{Name.last_name}#{city_suffix}"
street_name:
- "#{Name.first_name}#{street_suffix}"
- "#{Name.last_name}#{street_suffix}"
- "#{Name.first_name}"
- "#{Name.last_name}"
default_country: [日本]

ancient:
Expand Down
34 changes: 30 additions & 4 deletions test/test_ja_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,24 @@ def teardown

def test_ja_address_methods
assert Faker::Address.postcode.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.postcode)
assert Faker::Address.state.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.state)
assert Faker::Address.state_abbr.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.state_abbr)
assert Faker::Address.city_prefix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.city_prefix)
assert Faker::Address.city_suffix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.city_suffix)
assert Faker::Address.city.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.city)
assert Faker::Address.street_name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Address.street_name)
end

def test_ja_ancient_methods
assert Faker::Ancient.god.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Ancient.god)
end

def test_ja_cat_methods
Expand All @@ -35,12 +43,16 @@ def test_ja_color_methods

def test_ja_coffee_methods
assert Faker::Coffee.country.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Coffee.country)
end

def test_ja_company_methods
assert Faker::Company.suffix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Company.suffix)
assert Faker::Company.category.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Company.category)
assert Faker::Company.name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Company.name)
end

def test_ja_dog_methods
Expand All @@ -49,10 +61,12 @@ def test_ja_dog_methods

def test_ja_food_methods
assert Faker::Food.sushi.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Food.sushi)
end

def test_ja_gender_methods
assert Faker::Gender.binary_type.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Gender.binary_type)
end

def test_ja_lorem_methods
Expand All @@ -63,43 +77,55 @@ def test_ja_lorem_methods

def test_ja_name_methods
assert Faker::Name.last_name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Name.last_name)
assert Faker::Name.first_name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Name.first_name)
assert Faker::Name.name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Name.name)
assert Faker::Name.name_with_middle.is_a? String
assert Faker::Name.female_first_name.is_a? String
assert Faker::Name.male_first_name.is_a? String
assert Faker::Name.suffix.is_a? String
assert Faker::Name.prefix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Name.name_with_middle)
end

def test_ja_phone_number_methods
assert Faker::PhoneNumber.cell_phone.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::PhoneNumber.cell_phone)
assert Faker::PhoneNumber.phone_number.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::PhoneNumber.phone_number)
end

def test_ja_pokemon_methods
assert Faker::Games::Pokemon.name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Games::Pokemon.name)
assert Faker::Games::Pokemon.location.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Games::Pokemon.location)
assert Faker::Games::Pokemon.move.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Games::Pokemon.move)
end

def test_ja_zelda_methods
assert Faker::Games::Zelda.game.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Games::Zelda.game)
end

def test_ja_restaurant_methods
assert Faker::Restaurant.name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Restaurant.name)
assert Faker::Restaurant.type.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Restaurant.type)
end

def test_ja_space_methods
assert Faker::Space.planet.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::Space.planet)
assert Faker::Space.galaxy.is_a? String
end

def test_ja_university_methods
assert Faker::University.prefix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::University.prefix)
assert Faker::University.suffix.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::University.suffix)
assert Faker::University.name.is_a? String
assert_not_match(/[a-zA-Z]/, Faker::University.name)
end
end

0 comments on commit 5739c85

Please sign in to comment.