2017-11-27 05:45:24 -05:00
|
|
|
# frozen_string_literal: true
|
2018-03-26 01:56:26 -04:00
|
|
|
require 'minitest_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
|
|
|
|
|