From 57df455d1db26d36b2c6ea39bd23e05541934f63 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Mon, 17 Jan 2005 18:25:13 +0000 Subject: [PATCH] Removed accidentally duplicated code --- test/functional/wiki_controller_test.rb | 27 +------------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 2535b4b8..28c1787e 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -264,7 +264,7 @@ class WikiControllerTest < Test::Unit::TestCase if ENV['INSTIKI_TEST_LATEX'] or defined? $INSTIKI_TEST_PDFLATEX - + def test_pdf assert RedClothForTex.available?, 'Cannot do test_pdf when pdflatex is not available' r = process('pdf', 'web' => 'wiki1', 'id' => 'HomePage') @@ -279,32 +279,7 @@ class WikiControllerTest < Test::Unit::TestCase assert_match /attachment; filename="HomePage-wiki1-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.pdf"/, r.headers['Content-Disposition'] end - - def test_pdf - assert RedClothForTex.available?, 'Cannot do test_pdf when pdflatex is not available' - r = process('pdf', 'web' => 'wiki1', 'id' => 'HomePage') - assert_success - - sio = StringIO.new - begin - $stdout = sio - r.body.call - ensure - $stdout = STDOUT - end - - sio.rewind - content = sio.read - - assert_equal '%PDF', content[0..3] - assert_equal "EOF\n", content[-4..-1] - assert_equal 'application/octet_stream', r.headers['Content-Type'] - assert_match /attachment; filename="HomePage-wiki1-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.pdf"/, - r.headers['Content-Disposition'] - end - - else puts 'Warning: tests involving pdflatex are very slow, therefore they are disable by default.' puts ' Set environment variable INSTIKI_TEST_PDFLATEX or global Ruby variable'