summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/to_test.rb
diff options
context:
space:
mode:
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
+