File: test_faker_construction.rb

package info (click to toggle)
ruby-faker 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,596 kB
  • sloc: ruby: 20,656; sh: 6; makefile: 6
file content (46 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download
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
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerConstruction < Test::Unit::TestCase
  def setup
    Faker::Config.locale = nil
  end

  def test_material
    assert_match(/\w+/, Faker::Construction.material)
  end

  def test_heavy_equipment
    assert_match(/\w+/, Faker::Construction.heavy_equipment)
  end

  def test_trade
    assert_match(/\w+/, Faker::Construction.trade)
  end

  def test_subcontract_category
    assert_match(/\w+/, Faker::Construction.subcontract_category)
  end

  def test_standard_cost_code
    assert_match(/\w+/, Faker::Construction.standard_cost_code)
  end

  def test_role
    assert_match(/\w+/, Faker::Construction.role)
  end

  def test_locales
    [nil, 'en'].each do |locale_name|
      Faker::Config.locale = locale_name

      assert_kind_of String, Faker::Construction.material
      assert_kind_of String, Faker::Construction.subcontract_category
      assert_kind_of String, Faker::Construction.standard_cost_code
      assert_kind_of String, Faker::Construction.trade
      assert_kind_of String, Faker::Construction.role
      assert_kind_of String, Faker::Construction.heavy_equipment
    end
  end
end