Sha256: 20a72435023cf5b14913213e846e1bff1443e1b24033ee3e368c602633604e79

Contents?: true

Size: 903 Bytes

Versions: 4

Compression:

Stored size: 903 Bytes

Contents

# frozen_string_literal: true

require 'helper'

class TestFakerIdentificationESCO < Test::Unit::TestCase
  include Test::Unit::Assertions
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::IdentificationESCO,
    :drivers_license, :driver_license_category, :blood_type, :expedition_date
  )

  def setup
    @tester = FFaker::IdentificationESCO
  end

  def test_drivers_license
    assert_match(/\A\d{6,14}\z/, @tester.drivers_license)
  end

  def test_id
    assert @tester.method_defined?(:id)
  end

  def test_gender
    assert_match(/\A(Hombre|Mujer)\z/, @tester.gender)
  end

  def test_category
    assert_match(/\A([a][1-2]|[bc][1-3])\z/i, @tester.driver_license_category)
  end

  def test_blood_type
    assert_match(/\A(a|b|o|ab)[+-]\z/i, @tester.blood_type)
  end

  def test_expedition_date
    assert_less_than @tester.expedition_date, Date.today
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffaker-2.16.0 test/test_identification_co.rb
ffaker-2.15.0 test/test_identification_co.rb
ffaker-2.14.0 test/test_identification_co.rb
ffaker-2.13.0 test/test_identification_co.rb