summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_attr.rb
blob: 362326186b606d31d9be5120e48b961f5cf0edcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'rubygems'
require 'minitest/autorun'
require 'rdoc/rdoc'

class TestRDocAttr < MiniTest::Unit::TestCase

  def setup
    @a = RDoc::Attr.new nil, 'attr', 'RW', ''
  end

  def test_block_params
    assert_nil @a.block_params
  end

  def test_call_seq
    assert_nil @a.call_seq
  end

  def test_full_name
    assert_equal '(unknown)#attr', @a.full_name
  end

  def test_singleton
    refute @a.singleton
  end

  def test_type
    assert_equal 'attr_accessor', @a.type

    @a.rw = 'R'

    assert_equal 'attr_reader', @a.type

    @a.rw = 'W'

    assert_equal 'attr_writer', @a.type
  end

end