From 79a313948f2277cf0f2e238d5765a71fee03e089 Mon Sep 17 00:00:00 2001 From: murphy Date: Thu, 25 Dec 2008 01:22:30 +0000 Subject: Fixes for Ruby 1.9. --- test/functional/basic.rb | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'test/functional/basic.rb') diff --git a/test/functional/basic.rb b/test/functional/basic.rb index 8f9e523..d629bd5 100755 --- a/test/functional/basic.rb +++ b/test/functional/basic.rb @@ -34,32 +34,40 @@ class BasicTest < Test::Unit::TestCase CodeRay::Duo[:plain, :plain].highlight(RUBY_TEST_CODE, :stream => true)) end - def test_for_redcloth + begin require 'rubygems' - require 'coderay/for_redcloth' - assert_equal "

puts \"Hello, World!\"

", - RedCloth.new('@[ruby]puts "Hello, World!"@').to_html - assert_equal <<-BLOCKCODE.chomp, + gem 'RedCloth', '>= 4.0.3' rescue nil + require 'redcloth' + + def test_for_redcloth + require 'rubygems' + require 'coderay/for_redcloth' + assert_equal "

puts \"Hello, World!\"

", + RedCloth.new('@[ruby]puts "Hello, World!"@').to_html + assert_equal <<-BLOCKCODE.chomp,
puts "Hello, World!"
-BLOCKCODE - RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html - end + BLOCKCODE + RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html + end - def test_for_redcloth_escapes - require 'rubygems' - require 'coderay/for_redcloth' - assert_equal '

>

', - RedCloth.new('@[ruby]>@').to_html - assert_equal <<-BLOCKCODE.chomp, + def test_for_redcloth_escapes + require 'rubygems' + require 'coderay/for_redcloth' + assert_equal '

>

', + RedCloth.new('@[ruby]>@').to_html + assert_equal <<-BLOCKCODE.chomp,
&
-BLOCKCODE - RedCloth.new('bc[ruby]. &').to_html + BLOCKCODE + RedCloth.new('bc[ruby]. &').to_html + end + rescue LoadError + $stderr.puts 'RedCloth not found.' end ENCODERS_LIST = %w( -- cgit v1.2.1