Sha256: ba4bc280df8824b454c2c259e014fac58876960cd1ab3e389546fc3a912a42d3

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require 'helper'

class TestFFaker < Test::Unit::TestCase
  include DeterministicHelper

  def test_version
    assert FFaker::VERSION.is_a?(String)
  end

  def test_numerify
    assert FFaker.numerify('###').match(/\d{3}/)
    assert_deterministic { FFaker.numerify('###') }
  end

  def test_numerify_with_array
    assert FFaker.numerify(['###', '###']).match(/\d{3}/)
    assert_deterministic { FFaker.numerify(['###', '###']) }
  end

  def test_letterify
    assert FFaker.letterify('???').match(/[a-z]{3}/)
    assert_deterministic { FFaker.letterify('???') }
  end

  def test_letterify_with_array
    assert FFaker.letterify(['???', '???']).match(/[a-z]{3}/)
    assert_deterministic { FFaker.letterify(['???', '???']) }
  end

  def test_bothify
    assert FFaker.bothify('???###').match(/[a-z]{3}\d{3}/)
    assert_deterministic { FFaker.bothify('???###') }
  end

  def test_bothify_with_array
    assert FFaker.bothify(['???###', '???###']).match(/[a-z]{3}\d{3}/)
    assert_deterministic { FFaker.bothify(['???###', '???###']) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffaker-2.18.0 test/test_ffaker.rb
ffaker-2.17.0 test/test_ffaker.rb