Sha256: 17e8db439d48fec3619cc3d39bf20632088e0bba4cde2ade67c30742209c4322

Contents?: true

Size: 854 Bytes

Versions: 11

Compression:

Stored size: 854 Bytes

Contents

require 'helper'

class ParserTest < Test::Unit::TestCase
  # cache parsing to speed things up
  @@namespace = Dub.parse(fixture('namespacecv.xml'))
  @@group = Dub.parse(fixture('group___magic_type.xml'))

  context 'Parsing a namespace' do
    setup do
      @parser = @@namespace
    end

    should 'find cv namespace with namespace method' do
      assert_kind_of Dub::Namespace, @parser.namespace(:cv)
    end

    should 'find namespace with array index' do
      assert_kind_of Dub::Namespace, @parser[:cv]
    end
  end

  context 'Parsing a group' do
    setup do
      @parser = @@group
    end

    should 'find MagicType group with group method' do
      assert_kind_of Dub::Namespace, @parser.group(:MagicType)
    end

    should 'find group with array index' do
      assert_kind_of Dub::Namespace, @parser[:MagicType]
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dub-1.0.0 test/parser_test.rb
dub-0.7.0 test/parser_test.rb
dub-0.6.6 test/parser_test.rb
dub-0.6.5 test/parser_test.rb
dub-0.6.4 test/parser_test.rb
dub-0.6.3 test/parser_test.rb
dub-0.6.2 test/parser_test.rb
dub-0.6.1 test/parser_test.rb
dub-0.6.0 test/parser_test.rb
dub-0.5.1 test/parser_test.rb
dub-0.5.0 test/parser_test.rb