HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/test/rdoc/test_rdoc_markup_paragraph.rb
# frozen_string_literal: true
require 'rdoc/test_case'

class TestRDocMarkupParagraph < RDoc::TestCase

  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

    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")
  end

end