~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/rdoc/test_rdoc_markup_indented_paragraph.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'pp'
 
2
require 'rubygems'
 
3
require 'minitest/autorun'
 
4
require 'rdoc/markup'
 
5
 
 
6
class TestRDocMarkupIndentedParagraph < MiniTest::Unit::TestCase
 
7
 
 
8
  def setup
 
9
    @IP = RDoc::Markup::IndentedParagraph
 
10
  end
 
11
 
 
12
  def test_initialize
 
13
    ip = @IP.new 2, 'a', 'b'
 
14
 
 
15
    assert_equal 2, ip.indent
 
16
    assert_equal %w[a b], ip.parts
 
17
  end
 
18
 
 
19
  def test_accept
 
20
    visitor = Object.new
 
21
    def visitor.accept_indented_paragraph(obj) @obj = obj end
 
22
    def visitor.obj() @obj end
 
23
 
 
24
    paragraph = @IP.new 0
 
25
 
 
26
    paragraph.accept visitor
 
27
 
 
28
    assert_equal paragraph, visitor.obj
 
29
  end
 
30
 
 
31
  def test_equals2
 
32
    one = @IP.new 1
 
33
    two = @IP.new 2
 
34
 
 
35
    assert_equal one, one
 
36
    refute_equal one, two
 
37
  end
 
38
 
 
39
end
 
40