Sha256: 086db6a1f3dce484f48fe118db5f21a2050a73ccb6f1e08fd1ba2e1b8bfcebfb

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

require_relative './test_helper'

class TestGenerator < Minitest::Test
  def test_random
    assert (3..7).include?(Generator.random.length)
    assert_equal 5, Generator.random(5).length
  end

  def test_human
    assert (3..7).include?(Generator.human.length)
    assert_equal 5, Generator.human(5).length
  end

  def test_format
    name = Generator.format('a?*#z')

    assert_equal 5, name.length

    assert_equal 'a', name[0]
    assert_equal 'z', name[4]

    assert_includes String::ALPHABET, name[1]
    assert_includes String::VOWELS, name[2]
    assert_includes String::CONSONANTS, name[3]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
namna-0.0.4 test/generator_test.rb