Sha256: 2f8b96169efbf0b41866959d1f0e80b807b13d373bab173f6cd656f08d44ae87

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

require 'test_helper'
require 'indirizzo/constants'

include Indirizzo

class TestConstants < Test::Unit::TestCase
  def initialize (*args)
    @map = Map[
      "Abbreviation" => "abbr",
      "Two words"    => "2words",
      "Some three words" => "3words"
    ]
    super(*args)
  end
  def test_class_constructor
    assert_kind_of Map, @map
    assert_kind_of Hash, @map
  end  
  def test_key
    assert @map.key?( "Abbreviation" )
    assert @map.key?( "abbreviation" )
    assert !(@map.key? "abbreviation?")
    assert @map.key?( "abbr" )
    assert @map.key?( "Two words" )
    assert @map.key?( "2words" )
  end
  def test_fetch
    assert_equal "abbr", @map["Abbreviation"]
    assert_equal "abbr", @map["abbreviation"]
    assert_nil @map["abbreviation?"]
    assert_equal "abbr", @map["abbr"]
    assert_equal "2words", @map["Two words"]
    assert_equal "2words", @map["2words"]
  end
#  def test_partial
#    assert @map.partial?( "Abbreviation" )
#    assert @map.partial?( "Two" )
#    assert @map.partial?( "two" )
#    assert !(@map.partial? "words")
#    assert @map.partial?( "Some" )
#    assert !(@map.partial? "words")
#    assert @map.partial?( "Some three" )
#    assert @map.partial?( "SOME THREE WORDS" )
#  end
  def test_constants
    assert_kind_of Map, Directional
    assert_kind_of Map, Prefix_Qualifier
    assert_kind_of Map, Suffix_Qualifier
    assert_kind_of Map, Prefix_Type
    assert_kind_of Map, Suffix_Type
    assert_kind_of Map, Unit_Type
    assert_kind_of Map, Name_Abbr
    assert_kind_of Map, State
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
HornsAndHooves-indirizzo-0.1.7.1 test/test_constants.rb
Indirizzo-0.1.7 test/test_constants.rb
Indirizzo-0.1.5 test/test_constants.rb
Indirizzo-0.1.4 test/test_constants.rb
Indirizzo-0.1.3 test/test_constants.rb
Indirizzo-0.1.1 test/test_constants.rb
Indirizzo-0.1.0 test/test_constants.rb