diff options
Diffstat (limited to 'test/rdoc/test_attribute_manager.rb')
-rw-r--r-- | test/rdoc/test_attribute_manager.rb | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/test/rdoc/test_attribute_manager.rb b/test/rdoc/test_attribute_manager.rb index ee45c0596f..9506f3b40f 100644 --- a/test/rdoc/test_attribute_manager.rb +++ b/test/rdoc/test_attribute_manager.rb @@ -1,5 +1,7 @@ require 'rubygems' -require 'minitest/unit' +require 'minitest/autorun' +require 'rdoc' +require 'rdoc/markup' require 'rdoc/markup/attribute_manager' class TestAttributeManager < MiniTest::Unit::TestCase @@ -9,29 +11,21 @@ class TestAttributeManager < MiniTest::Unit::TestCase @klass = RDoc::Markup::AttributeManager end - def teardown - silently do - @klass.const_set(:MATCHING_WORD_PAIRS, {}) - @klass.const_set(:WORD_PAIR_MAP, {}) - @klass.const_set(:HTML_TAGS, {}) - end - end - def test_initial_word_pairs - word_pairs = @klass::MATCHING_WORD_PAIRS + word_pairs = @am.matching_word_pairs assert word_pairs.is_a?(Hash) assert_equal(3, word_pairs.size) end def test_initial_html - html_tags = @klass::HTML_TAGS + html_tags = @am.html_tags assert html_tags.is_a?(Hash) assert_equal(5, html_tags.size) end def test_add_matching_word_pair @am.add_word_pair("x","x", :TEST) - word_pairs = @klass::MATCHING_WORD_PAIRS + word_pairs = @am.matching_word_pairs assert_equal(4,word_pairs.size) assert(word_pairs.has_key?("x")) end @@ -44,21 +38,21 @@ class TestAttributeManager < MiniTest::Unit::TestCase def test_add_word_pair_map @am.add_word_pair("x", "y", :TEST) - word_pair_map = @klass::WORD_PAIR_MAP + word_pair_map = @am.word_pair_map assert_equal(1,word_pair_map.size) assert_equal(word_pair_map. keys.first.source, "(x)(\\S+)(y)") end def test_add_html_tag @am.add_html("Test", :TEST) - tags = @klass::HTML_TAGS + tags = @am.html_tags assert_equal(6, tags.size) assert(tags.has_key?("test")) end def test_add_special @am.add_special("WikiWord", :WIKIWORD) - specials = @klass::SPECIAL + specials = @am.special assert_equal(1,specials.size) assert(specials.has_key?("WikiWord")) end @@ -73,4 +67,3 @@ class TestAttributeManager < MiniTest::Unit::TestCase end -MiniTest::Unit.autorun |