forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_uk_locale.rb
57 lines (47 loc) · 1.61 KB
/
test_uk_locale.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# frozen_string_literal: true
require_relative 'test_helper'
class TestUkLocale < Test::Unit::TestCase
def setup
@previous_locale = Faker::Config.locale
Faker::Config.locale = 'uk'
end
def teardown
Faker::Config.locale = @previous_locale
end
def test_uk_zipcode_length
assert_match(/^\d{5}$/, Faker::Address.zip_code)
assert_send([Faker::Address, :street_prefix])
end
def test_uk_address_absent
assert_nil(Faker::Address.city_prefix)
assert_nil(Faker::Address.city_suffix)
assert_nil(Faker::Address.state_abbr)
end
def test_uk_romanize_cyrillic
assert Faker::Char.romanize_cyrillic('').is_a? String
end
def test_uk_company_prefix_returns_true_value
assert_send([Faker::Company, :prefix])
end
def test_uk_commerce_methods
assert Faker::Commerce.color.is_a? String
assert Faker::Commerce.product_name.is_a? String
assert Faker::Commerce.department.is_a? String
end
def test_uk_internet_methods
assert_match(/.+@[^.].+\.\w+/, Faker::Internet.email)
assert_match(/^[\w-]+$/, Faker::Internet.domain_word)
end
def test_uk_name_methods
assert Faker::Name.male_first_name.is_a? String
assert Faker::Name.male_middle_name.is_a? String
assert Faker::Name.male_last_name.is_a? String
assert Faker::Name.female_first_name.is_a? String
assert Faker::Name.name_with_middle.is_a? String
assert Faker::Name.female_middle_name.is_a? String
assert Faker::Name.female_last_name.is_a? String
assert Faker::Name.first_name.is_a? String
assert Faker::Name.last_name.is_a? String
assert Faker::Name.name.is_a? String
end
end