diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index b7823b9394a4eb2be8507ac49de1526c12d5e31a..08143ba6808c02ce4b2ce2b86fbb32aa8e646787 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -1,6 +1,10 @@ require 'abstract_unit' require 'testing_sandbox' -require 'redcloth' +begin + require 'redcloth' +rescue LoadError + $stderr.puts "Skipping textilize tests. `gem install RedCloth` to enable." +end class TextHelperTest < ActionView::TestCase tests ActionView::Helpers::TextHelper @@ -530,19 +534,21 @@ def test_cycle_no_instance_variable_clashes assert_equal(%w{Specialized Fuji Giant}, @cycles) end - def test_textilize - assert_equal("

This is Textile! Rejoice!

", textilize("*This is Textile!* Rejoice!")) - end + if defined? RedCloth + def test_textilize + assert_equal("

This is Textile! Rejoice!

", textilize("*This is Textile!* Rejoice!")) + end - def test_textilize_with_blank - assert_equal("", textilize("")) - end + def test_textilize_with_blank + assert_equal("", textilize("")) + end - def test_textilize_with_options - assert_equal("

This is worded <strong>strongly</strong>

", textilize("This is worded strongly", :filter_html)) - end + def test_textilize_with_options + assert_equal("

This is worded <strong>strongly</strong>

", textilize("This is worded strongly", :filter_html)) + end - def test_textilize_with_hard_breaks - assert_equal("

This is one scary world.
\n True.

", textilize("This is one scary world.\n True.")) + def test_textilize_with_hard_breaks + assert_equal("

This is one scary world.
\n True.

", textilize("This is one scary world.\n True.")) + end end end