Sha256: fd5f34d6ca053d1e21d0dd844caf7994f966ffdc9bc0aeadd0dfc3aa33cde379

Contents?: true

Size: 1.32 KB

Versions: 124

Compression:

Stored size: 1.32 KB

Contents

require 'rdoc/test_case'

class TestRDocRdInline < RDoc::TestCase

  def setup
    super

    @inline = RDoc::RD::Inline.new '+text+', 'text'
  end

  def test_class_new
    inline = RDoc::RD::Inline.new @inline

    refute_equal inline.rdoc, inline.reference
  end

  def test_initialize
    inline = RDoc::RD::Inline.new 'text'

    assert_equal inline.rdoc, inline.reference
    refute_same  inline.rdoc, inline.reference
  end

  def test_initialize_inline
    inline = RDoc::RD::Inline.new @inline

    assert_equal '+text+', inline.rdoc
    assert_equal 'text',   inline.reference
  end

  def test_append_inline
    out = @inline.append @inline

    assert_same @inline, out

    assert_equal '+text++text+', @inline.rdoc
    assert_equal 'texttext',     @inline.reference
  end

  def test_append_string
    @inline.append ' more'

    assert_equal '+text+ more', @inline.rdoc
    assert_equal 'text more',   @inline.reference
  end

  def test_equals2
    assert_equal @inline, RDoc::RD::Inline.new('+text+', 'text')
    refute_equal @inline, RDoc::RD::Inline.new('+text+', 'other')
    refute_equal @inline, RDoc::RD::Inline.new('+other+', 'text')
    refute_equal @inline, Object.new
  end

  def test_inspect
    assert_equal '(inline: +text+)', @inline.inspect
  end

  def test_to_s
    assert_equal '+text+', @inline.to_s
  end

end

Version data entries

124 entries across 98 versions & 24 rubygems

Version Path
rdoc-4.3.0 test/test_rdoc_rd_inline.rb
rdoc-4.2.2 test/test_rdoc_rd_inline.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rdoc-4.1.1/test/test_rdoc_rd_inline.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rdoc-4.1.1/test/test_rdoc_rd_inline.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rdoc-4.1.1/test/test_rdoc_rd_inline.rb
rdoc-4.2.1 test/test_rdoc_rd_inline.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rdoc-3.12.1/test/test_rdoc_rd_inline.rb
rdoc-4.2.0 test/test_rdoc_rd_inline.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rdoc-3.12.2/test/test_rdoc_rd_inline.rb
rdoc-4.1.2 test/test_rdoc_rd_inline.rb
rdoc-4.1.1 test/test_rdoc_rd_inline.rb
rdoc-4.1.0 test/test_rdoc_rd_inline.rb
rdoc-4.1.0.preview.3 test/test_rdoc_rd_inline.rb
candlepin-api-0.4.0 bundle/ruby/gems/rdoc-4.0.1/test/test_rdoc_rd_inline.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/rdoc-4.0.1/test/test_rdoc_rd_inline.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/rdoc-4.0.1/test/test_rdoc_rd_inline.rb
swipe-rails-0.0.5 vendor/bundle/gems/rdoc-3.12.2/test/test_rdoc_rd_inline.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rdoc-3.12.1/test/test_rdoc_rd_inline.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rdoc-3.12.1/test/test_rdoc_rd_inline.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rdoc-3.12.1/test/test_rdoc_rd_inline.rb