mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	 1c279a7d27
			
		
	
	
		1c279a7d27
		
	
	
	
	
		
			
			* 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
		
			
				
	
	
		
			63 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| 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
 | |
| 
 |