1require 'rdoc/test_case' 2 3class TestRDocMarkupAttributes < RDoc::TestCase 4 5 def setup 6 super 7 8 @as = RDoc::Markup::Attributes.new 9 end 10 11 def test_bitmap_for 12 assert_equal 2, @as.bitmap_for('two') 13 assert_equal 2, @as.bitmap_for('two') 14 assert_equal 4, @as.bitmap_for('three') 15 end 16 17 def test_as_string 18 @as.bitmap_for 'two' 19 @as.bitmap_for 'three' 20 21 assert_equal 'none', @as.as_string(0) 22 assert_equal '_SPECIAL_', @as.as_string(1) 23 assert_equal 'two', @as.as_string(2) 24 assert_equal '_SPECIAL_,two', @as.as_string(3) 25 end 26 27 def test_each_name_of 28 @as.bitmap_for 'two' 29 @as.bitmap_for 'three' 30 31 assert_equal %w[], @as.each_name_of(0).to_a 32 assert_equal %w[], @as.each_name_of(1).to_a 33 assert_equal %w[two], @as.each_name_of(2).to_a 34 assert_equal %w[three], @as.each_name_of(4).to_a 35 assert_equal %w[two three], @as.each_name_of(6).to_a 36 end 37 38end 39 40