From 2ef9c50c6e405717d06362787c4549ca4f1c6485 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 20 Dec 2010 03:22:49 +0000 Subject: Import RDoc 3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_parser.rb | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'test/rdoc/test_rdoc_parser.rb') diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb index ebb520032d..2eb1ac1a67 100644 --- a/test/rdoc/test_rdoc_parser.rb +++ b/test/rdoc/test_rdoc_parser.rb @@ -11,25 +11,6 @@ class TestRDocParser < MiniTest::Unit::TestCase @binary_dat = File.expand_path '../binary.dat', __FILE__ end - def test_class_binary_eh_erb - erb = File.join Dir.tmpdir, "test_rdoc_parser_#{$$}.erb" - open erb, 'wb' do |io| - io.write 'blah blah <%= stuff %> <% more stuff %>' - end - - assert @RP.binary?(erb) - - erb_rb = File.join Dir.tmpdir, "test_rdoc_parser_#{$$}.erb.rb" - open erb_rb, 'wb' do |io| - io.write 'blah blah <%= stuff %>' - end - - refute @RP.binary?(erb_rb) - ensure - File.unlink erb - File.unlink erb_rb if erb_rb - end - def test_class_binary_eh_marshal marshal = File.join Dir.tmpdir, "test_rdoc_parser_#{$$}.marshal" open marshal, 'wb' do |io| @@ -42,6 +23,18 @@ class TestRDocParser < MiniTest::Unit::TestCase File.unlink marshal end + def test_class_binary_japanese_text + file_name = File.expand_path '../test.ja.txt', __FILE__ + refute @RP.binary?(file_name) + end + + def test_class_binary_japanese_rdoc + skip "Encoding not implemented" unless Object.const_defined? :Encoding + + file_name = File.expand_path '../test.ja.rdoc', __FILE__ + refute @RP.binary?(file_name) + end + def test_class_can_parse assert_equal @RP.can_parse(__FILE__), @RP::Ruby @@ -72,6 +65,10 @@ class TestRDocParser < MiniTest::Unit::TestCase def test_class_for_binary rp = @RP.dup + class << rp + alias old_can_parse can_parse + end + def rp.can_parse(*args) nil end assert_nil @RP.for(nil, @binary_dat, nil, nil, nil) -- cgit v1.2.3