diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
commit | 1c279a7d2753949c725754e1302f791b76358114 (patch) | |
tree | 36aa3bdde250e564445eba5f2e25fcb96bcb6cef /test/rdoc/test_rdoc_rd_inline.rb | |
parent | c72f0daa877808e4fa5018b3191ca09d4b97c03d (diff) | |
download | ruby-1c279a7d2753949c725754e1302f791b76358114.tar.gz |
* lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc: ditto
* test/rdoc: ditto
* NEWS: Updated with RDoc 4.0 information
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_rd_inline.rb')
-rw-r--r-- | test/rdoc/test_rdoc_rd_inline.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_rd_inline.rb b/test/rdoc/test_rdoc_rd_inline.rb new file mode 100644 index 0000000000..d601ecca1a --- /dev/null +++ b/test/rdoc/test_rdoc_rd_inline.rb @@ -0,0 +1,63 @@ +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 + |