diff options
Diffstat (limited to 'trunk/test/rdoc/test_rdoc_ri_attribute_formatter.rb')
-rw-r--r-- | trunk/test/rdoc/test_rdoc_ri_attribute_formatter.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/trunk/test/rdoc/test_rdoc_ri_attribute_formatter.rb b/trunk/test/rdoc/test_rdoc_ri_attribute_formatter.rb new file mode 100644 index 0000000000..d61a6f5cbc --- /dev/null +++ b/trunk/test/rdoc/test_rdoc_ri_attribute_formatter.rb @@ -0,0 +1,42 @@ +require 'stringio' +require 'test/unit' +require 'rdoc/ri/formatter' + +class TestRDocRIAttributeFormatter < Test::Unit::TestCase + + def setup + @output = StringIO.new + @width = 78 + @indent = ' ' + + @f = RDoc::RI::AttributeFormatter.new @output, @width, @indent + end + + def test_wrap_empty + @f.wrap '' + assert_equal '', @output.string + end + + def test_wrap_long + @f.wrap 'a ' * (@width / 2) + assert_equal " a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \n a \n", + @output.string + end + + def test_wrap_markup + @f.wrap 'a <tt>b</tt> c' + assert_equal " a b c\n", @output.string + end + + def test_wrap_nil + @f.wrap nil + assert_equal '', @output.string + end + + def test_wrap_short + @f.wrap 'a b c' + assert_equal " a b c\n", @output.string + end + +end + |