summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-24 23:05:28 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-24 23:05:28 +0000
commit7222e82a8b98afdc61b9cf6ad7419068429a42e9 (patch)
tree9601822113feef70fe4f6fc19b5453dd378dcd62 /test/rdoc
parentda6300e8f888d0664347a5f2fb43dc749df7b5ad (diff)
Import RDoc 2.2.2 r192
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_attribute_manager.rb15
-rw-r--r--test/rdoc/test_rdoc_info_formatting.rb12
-rw-r--r--test/rdoc/test_rdoc_info_sections.rb7
-rw-r--r--test/rdoc/test_rdoc_markup.rb6
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb9
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb7
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb10
-rw-r--r--test/rdoc/test_rdoc_parser.rb9
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb6
-rw-r--r--test/rdoc/test_rdoc_parser_perl.rb6
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb6
-rw-r--r--test/rdoc/test_rdoc_ri_attribute_formatter.rb6
-rw-r--r--test/rdoc/test_rdoc_ri_default_display.rb12
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb6
-rw-r--r--test/rdoc/test_rdoc_ri_formatter.rb10
-rw-r--r--test/rdoc/test_rdoc_ri_overstrike_formatter.rb6
16 files changed, 90 insertions, 43 deletions
diff --git a/test/rdoc/test_attribute_manager.rb b/test/rdoc/test_attribute_manager.rb
index 298eca0..ee45c05 100644
--- a/test/rdoc/test_attribute_manager.rb
+++ b/test/rdoc/test_attribute_manager.rb
@@ -1,15 +1,16 @@
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/markup/attribute_manager'
-class TestAttributeManager < Test::Unit::TestCase
+class TestAttributeManager < MiniTest::Unit::TestCase
def setup
@am = RDoc::Markup::AttributeManager.new
@klass = RDoc::Markup::AttributeManager
end
-
+
def teardown
- silently do
+ silently do
@klass.const_set(:MATCHING_WORD_PAIRS, {})
@klass.const_set(:WORD_PAIR_MAP, {})
@klass.const_set(:HTML_TAGS, {})
@@ -34,9 +35,9 @@ class TestAttributeManager < Test::Unit::TestCase
assert_equal(4,word_pairs.size)
assert(word_pairs.has_key?("x"))
end
-
+
def test_add_invalid_word_pair
- assert_raise ArgumentError do
+ assert_raises ArgumentError do
@am.add_word_pair("<", "<", :TEST)
end
end
@@ -71,3 +72,5 @@ class TestAttributeManager < Test::Unit::TestCase
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_info_formatting.rb b/test/rdoc/test_rdoc_info_formatting.rb
index c0a9600..87147fb 100644
--- a/test/rdoc/test_rdoc_info_formatting.rb
+++ b/test/rdoc/test_rdoc_info_formatting.rb
@@ -1,11 +1,12 @@
require 'fileutils'
require 'tmpdir'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/generator/texinfo'
# From chapter 18 of the Pickaxe 3rd ed. and the TexInfo manual.
-class TestRDocInfoFormatting < Test::Unit::TestCase
+class TestRDocInfoFormatting < MiniTest::Unit::TestCase
def setup
@output_dir = File.join Dir.tmpdir, "test_rdoc_info_formatting_#{$$}"
@output_file = File.join @output_dir, 'rdoc.texinfo'
@@ -19,12 +20,13 @@ class TestRDocInfoFormatting < Test::Unit::TestCase
end
def teardown
- FileUtils.rm_rf @output_dir
+ # FileUtils.rm_rf @output_dir
end
# Make sure tags like *this* do not make HTML
def test_descriptions_are_not_html
- assert_no_match Regexp.new("\<b\>this\<\/b\>"), @text, "We had some HTML; icky!"
+ refute_match Regexp.new("\<b\>this\<\/b\>"), @text,
+ "We had some HTML; icky!"
end
# Ensure we get a reasonable amount
@@ -173,3 +175,5 @@ Second outer item.
assert string[regex] #, message
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_info_sections.rb b/test/rdoc/test_rdoc_info_sections.rb
index 6825d37..9571cd6 100644
--- a/test/rdoc/test_rdoc_info_sections.rb
+++ b/test/rdoc/test_rdoc_info_sections.rb
@@ -1,6 +1,7 @@
require 'fileutils'
require 'tempfile'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'tmpdir'
require 'rdoc/generator/texinfo'
@@ -9,7 +10,7 @@ require 'rdoc/generator/texinfo'
class RDoc::Generator::TEXINFO; attr_reader :files, :classes; end
class RDoc::RDoc; attr_reader :options; attr_reader :gen; end
-class TestRDocInfoSections < Test::Unit::TestCase
+class TestRDocInfoSections < MiniTest::Unit::TestCase
def setup
@output_dir = File.join Dir.tmpdir, "test_rdoc_info_sections_#{$$}"
@@ -134,3 +135,5 @@ end
DOC
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup.rb b/test/rdoc/test_rdoc_markup.rb
index d887438..7004fe5 100644
--- a/test/rdoc/test_rdoc_markup.rb
+++ b/test/rdoc/test_rdoc_markup.rb
@@ -1,8 +1,9 @@
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/markup'
require 'rdoc/markup/to_test'
-class TestRDocMarkup < Test::Unit::TestCase
+class TestRDocMarkup < MiniTest::Unit::TestCase
def basic_conv(str)
sm = RDoc::Markup.new
@@ -611,3 +612,4 @@ class TestRDocMarkup < Test::Unit::TestCase
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb
index cf10ff9..520470a 100644
--- a/test/rdoc/test_rdoc_markup_attribute_manager.rb
+++ b/test/rdoc/test_rdoc_markup_attribute_manager.rb
@@ -1,8 +1,9 @@
-require "test/unit"
+require "rubygems"
+require "minitest/unit"
require "rdoc/markup/inline"
require "rdoc/markup/to_html_crossref"
-class TestRDocMarkupAttributeManager < Test::Unit::TestCase
+class TestRDocMarkupAttributeManager < MiniTest::Unit::TestCase
def setup
@orig_special = RDoc::Markup::AttributeManager::SPECIAL
@@ -60,7 +61,7 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
end
def test_add_word_pair_angle
- e = assert_raise ArgumentError do
+ e = assert_raises ArgumentError do
@am.add_word_pair '<', '>', 'angles'
end
@@ -229,3 +230,5 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb
index 05fb9f2..b611b76 100644
--- a/test/rdoc/test_rdoc_markup_to_html.rb
+++ b/test/rdoc/test_rdoc_markup_to_html.rb
@@ -1,8 +1,9 @@
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/markup'
require 'rdoc/markup/to_html'
-class TestRDocMarkupToHtml < Test::Unit::TestCase
+class TestRDocMarkupToHtml < MiniTest::Unit::TestCase
def setup
@am = RDoc::Markup::AttributeManager.new
@@ -40,3 +41,5 @@ class TestRDocMarkupToHtml < Test::Unit::TestCase
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
index de99a58..baacda8 100644
--- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb
+++ b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
@@ -1,10 +1,14 @@
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/generator'
+require 'rdoc/stats'
+require 'rdoc/code_objects'
require 'rdoc/markup/to_html_crossref'
+require 'rdoc/parser/ruby'
require 'pathname'
-class TestRDocMarkupToHtmlCrossref < Test::Unit::TestCase
+class TestRDocMarkupToHtmlCrossref < MiniTest::Unit::TestCase
#
# This method parses a source file and returns a Hash mapping
@@ -286,3 +290,5 @@ class TestRDocMarkupToHtmlCrossref < Test::Unit::TestCase
verify_class_crossref xref, "Ref_Class4", "Ref_Class4::Ref_Class4"
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb
index 4f71974..d6420d2 100644
--- a/test/rdoc/test_rdoc_parser.rb
+++ b/test/rdoc/test_rdoc_parser.rb
@@ -1,12 +1,15 @@
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/parser'
+require 'rdoc/parser/ruby'
-class TestRDocParser < Test::Unit::TestCase
+class TestRDocParser < MiniTest::Unit::TestCase
def test_can_parse
assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby)
readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt")
- unless File.exist? readme_file_name then
+ unless File.exist? readme_file_name then # HACK for tests in trunk :/
readme_file_name = File.join File.dirname(__FILE__), '..', '..', 'README'
end
@@ -16,3 +19,5 @@ class TestRDocParser < Test::Unit::TestCase
assert_equal(RDoc::Parser.can_parse(binary_file_name), nil)
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb
index 9387a03..ebf9659 100644
--- a/test/rdoc/test_rdoc_parser_c.rb
+++ b/test/rdoc/test_rdoc_parser_c.rb
@@ -1,6 +1,7 @@
require 'stringio'
require 'tempfile'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/options'
require 'rdoc/parser/c'
@@ -10,7 +11,7 @@ class RDoc::Parser::C
public :do_classes, :do_constants
end
-class TestRDocParserC < Test::Unit::TestCase
+class TestRDocParserC < MiniTest::Unit::TestCase
def setup
@tempfile = Tempfile.new self.class.name
@@ -283,3 +284,4 @@ Init_IO(void) {
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_perl.rb b/test/rdoc/test_rdoc_parser_perl.rb
index 458e327..165cada 100644
--- a/test/rdoc/test_rdoc_parser_perl.rb
+++ b/test/rdoc/test_rdoc_parser_perl.rb
@@ -1,10 +1,11 @@
require 'stringio'
require 'tempfile'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/options'
require 'rdoc/parser/perl'
-class TestRdocParserPerlPOD < Test::Unit::TestCase
+class TestRdocParserPerlPOD < MiniTest::Unit::TestCase
def setup
@tempfile = Tempfile.new self.class.name
@@ -70,3 +71,4 @@ This just contains plain old documentation
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb
index 30ab3f8..3845fb2 100644
--- a/test/rdoc/test_rdoc_parser_ruby.rb
+++ b/test/rdoc/test_rdoc_parser_ruby.rb
@@ -1,12 +1,13 @@
require 'stringio'
require 'tempfile'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/options'
require 'rdoc/parser/ruby'
require 'rdoc/stats'
-class TestRDocParserRuby < Test::Unit::TestCase
+class TestRDocParserRuby < MiniTest::Unit::TestCase
def setup
@tempfile = Tempfile.new self.class.name
@@ -747,3 +748,4 @@ EOF
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_attribute_formatter.rb b/test/rdoc/test_rdoc_ri_attribute_formatter.rb
index d61a6f5..a863126 100644
--- a/test/rdoc/test_rdoc_ri_attribute_formatter.rb
+++ b/test/rdoc/test_rdoc_ri_attribute_formatter.rb
@@ -1,8 +1,9 @@
require 'stringio'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/ri/formatter'
-class TestRDocRIAttributeFormatter < Test::Unit::TestCase
+class TestRDocRIAttributeFormatter < MiniTest::Unit::TestCase
def setup
@output = StringIO.new
@@ -40,3 +41,4 @@ class TestRDocRIAttributeFormatter < Test::Unit::TestCase
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_default_display.rb b/test/rdoc/test_rdoc_ri_default_display.rb
index 266b501..1182b04 100644
--- a/test/rdoc/test_rdoc_ri_default_display.rb
+++ b/test/rdoc/test_rdoc_ri_default_display.rb
@@ -1,10 +1,11 @@
require 'stringio'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/ri/formatter'
require 'rdoc/ri/display'
require 'rdoc/ri/driver'
-class TestRDocRiDefaultDisplay < Test::Unit::TestCase
+class TestRDocRiDefaultDisplay < MiniTest::Unit::TestCase
def setup
@output = StringIO.new
@@ -52,11 +53,12 @@ class TestRDocRiDefaultDisplay < Test::Unit::TestCase
'includes' => [],
'instance_methods' => [
{ 'name' => 'instance_method' },
+ { 'name' => 'instance_method2' },
],
'instance_method_extensions' => [
{ 'name' => 'instance_method_extension' },
],
- 'superclass_string' => 'Object'
+ 'superclass' => 'Object'
@dd.display_class_info klass
@@ -100,7 +102,7 @@ Class method extensions:
Instance methods:
-----------------
- instance_method
+ instance_method, instance_method2
Instance method extensions:
@@ -295,3 +297,5 @@ install an additional package, or ask the packager to enable ri generation.
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb
index 22643d6..f160492 100644
--- a/test/rdoc/test_rdoc_ri_driver.rb
+++ b/test/rdoc/test_rdoc_ri_driver.rb
@@ -1,8 +1,9 @@
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'tmpdir'
require 'rdoc/ri/driver'
-class TestRDocRIDriver < Test::Unit::TestCase
+class TestRDocRIDriver < MiniTest::Unit::TestCase
def setup
@tmpdir = File.join Dir.tmpdir, "test_rdoc_ri_driver_#{$$}"
@@ -90,3 +91,4 @@ class TestRDocRIDriver < Test::Unit::TestCase
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_formatter.rb b/test/rdoc/test_rdoc_ri_formatter.rb
index 5393590..a70f9dc 100644
--- a/test/rdoc/test_rdoc_ri_formatter.rb
+++ b/test/rdoc/test_rdoc_ri_formatter.rb
@@ -1,9 +1,10 @@
require 'stringio'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/ri/formatter'
require 'rdoc/markup/to_flow'
-class TestRDocRIFormatter < Test::Unit::TestCase
+class TestRDocRIFormatter < MiniTest::Unit::TestCase
def setup
@output = StringIO.new
@@ -97,7 +98,7 @@ class TestRDocRIFormatter < Test::Unit::TestCase
end
def test_display_flow_item_unknown
- e = assert_raise RDoc::Error do
+ e = assert_raises RDoc::Error do
@f.display_flow_item Object.new
end
@@ -189,7 +190,7 @@ class TestRDocRIFormatter < Test::Unit::TestCase
list = RDoc::Markup::Flow::LIST.new :UNKNOWN
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
- e = assert_raise ArgumentError do
+ e = assert_raises ArgumentError do
@f.display_list list
end
@@ -316,3 +317,4 @@ class TestRDocRIFormatter < Test::Unit::TestCase
end
+MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_overstrike_formatter.rb b/test/rdoc/test_rdoc_ri_overstrike_formatter.rb
index 050e92a..38b9541 100644
--- a/test/rdoc/test_rdoc_ri_overstrike_formatter.rb
+++ b/test/rdoc/test_rdoc_ri_overstrike_formatter.rb
@@ -1,10 +1,11 @@
require 'stringio'
-require 'test/unit'
+require 'rubygems'
+require 'minitest/unit'
require 'rdoc/ri/formatter'
require 'rdoc/markup/fragments'
require 'rdoc/markup/to_flow'
-class TestRDocRIOverstrikeFormatter < Test::Unit::TestCase
+class TestRDocRIOverstrikeFormatter < MiniTest::Unit::TestCase
def setup
@output = StringIO.new
@@ -67,3 +68,4 @@ class TestRDocRIOverstrikeFormatter < Test::Unit::TestCase
end
+MiniTest::Unit.autorun