Sha256: ec826fbf2d948720d816ef298e1f451a12ea9913ef8f4b9b7b85976e24458b4f

Contents?: true

Size: 1.7 KB

Versions: 1

Compression:

Stored size: 1.7 KB

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')

class TestXMLHash < Test::Unit::TestCase
  def setup
    @contents = {'quaquaversally' => 'adjective: (of a geological formation) sloping downward from the center in all directions.',
                 'tergiversate' => 'To use evasions or ambiguities; equivocate.'}
  end

  def test_attrs_hash
    dict = DictionaryOfAttrs.from_xml(fixture(:dictionary_of_attrs))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_text_hash
    dict = DictionaryOfTexts.from_xml(fixture(:dictionary_of_texts))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_mixed_content_hash
    dict = DictionaryOfMixeds.from_xml(fixture(:dictionary_of_mixeds))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_name_hash
    dict = DictionaryOfNames.from_xml(fixture(:dictionary_of_names))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_guarded_name_hash
    dict = DictionaryOfGuardedNames.from_xml(fixture(:dictionary_of_guarded_names))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_text_name_clashes
    dict = DictionaryOfNameClashes.from_xml(fixture(:dictionary_of_name_clashes))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end

  def test_attr_name_clashes
    dict = DictionaryOfAttrNameClashes.from_xml(fixture(:dictionary_of_attr_name_clashes))
    assert_equal Hash, dict.definitions.class
    assert_equal @contents, dict.definitions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Empact-roxml-2.2 test/unit/xml_hash_test.rb