Sha256: 9fdbf0afcf00410a3c7906e40148c8f139ec0f8fc16f9c46f40c935ffb7c8184

Contents?: true

Size: 1.17 KB

Versions: 28

Compression:

Stored size: 1.17 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))

class TagsTest < Test::Unit::TestCase
  include PDocTestHelper
  
  def setup
    @parser = TagsParser.new
  end
  
  def test_valueless_tag
    tag = "deprecated"
    assert_parsed tag
    assert_equal "deprecated", parse(tag).to_a.first.name
    assert_equal nil,          parse(tag).to_a.first.value
  end
  
  def test_tag_with_value
    tag = "section: dom"
    assert_parsed tag
    assert_equal "section", parse(tag).to_a.first.name
    assert_equal "dom", parse(tag).to_a.first.value
    
    tag = "alias of: $A"
    assert_parsed tag
    assert_equal "alias of", parse(tag).to_a.first.name
    assert_equal "$A", parse(tag).to_a.first.value
  end
  
  def test_tags
    tags = "deprecated, alias of: $A"
    assert_parsed tags
    assert_equal "deprecated", parse(tags).to_a.first.name
    assert_equal nil,          parse(tags).to_a.first.value
    assert_equal "alias of",   parse(tags).to_a.last.name
    assert_equal "$A",         parse(tags).to_a.last.value
    assert                     parse(tags).include?("deprecated")
    assert                    !parse(tags).include?("foo")
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
distil-0.14.4 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.3 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.2 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.2.a vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.1 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.1.a vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.i vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.h vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.g vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.d vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.c vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.14.0.b vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.6 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.5 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.4 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.3 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.2 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.1 vendor/pdoc/test/unit/parser/tags_test.rb
distil-0.13.0 vendor/pdoc/test/unit/parser/tags_test.rb