2017-11-27 05:45:24 -05:00
|
|
|
# frozen_string_literal: true
|
2019-08-08 10:09:24 -04:00
|
|
|
require_relative 'helper'
|
2010-04-01 03:45:16 -04:00
|
|
|
|
2012-11-26 23:28:14 -05:00
|
|
|
class TestRDocMarkupParagraph < RDoc::TestCase
|
2010-04-01 03:45:16 -04:00
|
|
|
|
2011-06-16 00:59:24 -04:00
|
|
|
def test_accept
|
|
|
|
visitor = Object.new
|
|
|
|
def visitor.accept_paragraph(obj) @obj = obj end
|
|
|
|
def visitor.obj() @obj end
|
|
|
|
|
|
|
|
paragraph = RDoc::Markup::Paragraph.new
|
|
|
|
|
|
|
|
paragraph.accept visitor
|
|
|
|
|
2012-11-26 23:28:14 -05:00
|
|
|
assert_same paragraph, visitor.obj
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_text
|
|
|
|
paragraph = para('hello', ' world')
|
|
|
|
|
|
|
|
assert_equal 'hello world', paragraph.text
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_text_break
|
|
|
|
paragraph = para('hello', hard_break, 'world')
|
|
|
|
|
|
|
|
assert_equal 'helloworld', paragraph.text
|
|
|
|
|
|
|
|
assert_equal "hello\nworld", paragraph.text("\n")
|
2011-06-16 00:59:24 -04:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
end
|
|
|
|
|