mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
7222e82a8b
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
44 lines
887 B
Ruby
44 lines
887 B
Ruby
require 'stringio'
|
|
require 'rubygems'
|
|
require 'minitest/unit'
|
|
require 'rdoc/ri/formatter'
|
|
|
|
class TestRDocRIAttributeFormatter < MiniTest::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
|
|
|
|
MiniTest::Unit.autorun
|