Skip to content
This repository
Browse code

Fix that RedCloth shouldn't be required to run tests

  • Loading branch information...
commit d44b5c6219bdf5c8d80fe2f2006541d22227a8f5 1 parent c41fb58
Jeremy Kemper jeremy authored

Showing 1 changed file with 18 additions and 12 deletions. Show diff stats Hide diff stats

  1. +18 12 actionpack/test/template/text_helper_test.rb
30 actionpack/test/template/text_helper_test.rb
... ... @@ -1,6 +1,10 @@
1 1 require 'abstract_unit'
2 2 require 'testing_sandbox'
3   -require 'redcloth'
  3 +begin
  4 + require 'redcloth'
  5 +rescue LoadError
  6 + $stderr.puts "Skipping textilize tests. `gem install RedCloth` to enable."
  7 +end
4 8
5 9 class TextHelperTest < ActionView::TestCase
6 10 tests ActionView::Helpers::TextHelper
@@ -519,19 +523,21 @@ def test_cycle_no_instance_variable_clashes
519 523 assert_equal(%w{Specialized Fuji Giant}, @cycles)
520 524 end
521 525
522   - def test_textilize
523   - assert_equal("<p><strong>This is Textile!</strong> Rejoice!</p>", textilize("*This is Textile!* Rejoice!"))
524   - end
  526 + if defined? RedCloth
  527 + def test_textilize
  528 + assert_equal("<p><strong>This is Textile!</strong> Rejoice!</p>", textilize("*This is Textile!* Rejoice!"))
  529 + end
525 530
526   - def test_textilize_with_blank
527   - assert_equal("", textilize(""))
528   - end
  531 + def test_textilize_with_blank
  532 + assert_equal("", textilize(""))
  533 + end
529 534
530   - def test_textilize_with_options
531   - assert_equal("<p>This is worded &lt;strong&gt;strongly&lt;/strong&gt;</p>", textilize("This is worded <strong>strongly</strong>", :filter_html))
532   - end
  535 + def test_textilize_with_options
  536 + assert_equal("<p>This is worded &lt;strong&gt;strongly&lt;/strong&gt;</p>", textilize("This is worded <strong>strongly</strong>", :filter_html))
  537 + end
533 538
534   - def test_textilize_with_hard_breaks
535   - assert_equal("<p>This is one scary world.<br />\n True.</p>", textilize("This is one scary world.\n True."))
  539 + def test_textilize_with_hard_breaks
  540 + assert_equal("<p>This is one scary world.<br />\n True.</p>", textilize("This is one scary world.\n True."))
  541 + end
536 542 end
537 543 end

0 comments on commit d44b5c6

Please sign in to comment.
Something went wrong with that request. Please try again.