2017-11-27 13:45:24 +03:00
|
|
|
# frozen_string_literal: true
|
2018-03-26 08:56:26 +03:00
|
|
|
require 'minitest_helper'
|
2010-04-01 11:45:16 +04:00
|
|
|
|
2012-11-27 08:28:14 +04:00
|
|
|
class TestRDocMarkupParagraph < RDoc::TestCase
|
2010-04-01 11:45:16 +04:00
|
|
|
|
2011-06-16 08: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-27 08:28:14 +04: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 08:59:24 +04:00
|
|
|
end
|
|
|
|
|
2010-04-01 11:45:16 +04:00
|
|
|
end
|
|
|
|
|