aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/markup/to_test.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-19 00:06:19 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-19 00:06:19 +0000
commit8d37cefaf8795fe80d457f101fb9678fc7f6adf6 (patch)
treede06a2bb9bbbeffa5e12213e875a57fe269a2028 /lib/rdoc/markup/to_test.rb
parent9872d4d60048cc16cf78d2e8a260b78468e87fc9 (diff)
downloadruby-8d37cefaf8795fe80d457f101fb9678fc7f6adf6.tar.gz
* lib/rdoc/markup: Remove ListBase and Line constants.
* lib/rdoc/ri: Allow output IO to be specified. * test/rdoc/parser/test_parse_c.rb: Move up one level, fixed. * test/rdoc/parser/test_rdoc_markup_attribute_manager.rb: Renamed to match new class name, updated to match new classes. * test/rdoc/test_rdoc_ri_formatter.rb: Start of RI formatting tests. * test/rdoc/test_rdoc_ri_attribute_manager.rb: Start of RDoc::RI::AttributeManager tests. * test/rdoc/test_simple_markup.rb: Moved to match new class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup/to_test.rb')
-rw-r--r--lib/rdoc/markup/to_test.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/rdoc/markup/to_test.rb b/lib/rdoc/markup/to_test.rb
new file mode 100644
index 0000000000..eb183e5ba4
--- /dev/null
+++ b/lib/rdoc/markup/to_test.rb
@@ -0,0 +1,49 @@
+require 'rdoc/markup'
+
+##
+# This Markup outputter is used for testing purposes.
+
+class RDoc::Markup::ToTest
+
+ def start_accepting
+ @res = []
+ end
+
+ def end_accepting
+ @res
+ end
+
+ def accept_paragraph(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_verbatim(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_start(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_end(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_item(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_blank_line(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_heading(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_rule(am, fragment)
+ @res << fragment.to_s
+ end
+
+end
+