Sha256: f913b4476c8550e718901bdd62a53035882fd9fc1f3aa8fd282258f9dfc41cbf

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

require_relative './test_helper'

class TestString < Minitest::Test
  def test_constants
    assert_equal 26, String::ALPHABET.length
    assert_includes String::ALPHABET, 'a'
    assert_includes String::ALPHABET, 'b'

    assert_equal 5, String::VOWELS.length
    assert_includes String::VOWELS, 'a'
    refute_includes String::VOWELS, 'b'

    assert_equal 21, String::CONSONANTS.length
    assert_includes String::CONSONANTS, 'b'
    refute_includes String::CONSONANTS, 'a'
  end

  def test_namna_sub
    assert_equal 'a', 'a'.namna_sub
    assert_equal 'b', 'b'.namna_sub

    assert_includes String::ALPHABET, '?'.namna_sub

    assert_includes String::VOWELS, '*'.namna_sub
    refute_includes String::CONSONANTS, '*'.namna_sub

    assert_includes String::CONSONANTS, '#'.namna_sub
    refute_includes String::VOWELS, '#'.namna_sub
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
namna-0.0.4 test/string_test.rb