diff options
Diffstat (limited to 'test/rdoc/test_rdoc_parser.rb')
-rw-r--r-- | test/rdoc/test_rdoc_parser.rb | 35 |
1 files changed, 16 insertions, 19 deletions
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) |