Sha256: d50460d2d8381e37dfec2cf3ab957dba355b926a2b57ba45c7dc76b9056bca7b

Contents?: true

Size: 1.11 KB

Versions: 12

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'
require 'stringex'

begin
  require 'rubygems'
  require 'RedCloth'
rescue LoadError
  puts
  puts ">> Could not load RedCloth. String#to_html was not tested."
  puts ">> Please gem install RedCloth if you'd like to use this functionality."
  puts
end

class RedclothToHTMLTest < Test::Unit::TestCase
  if defined?(RedCloth)
    def test_to_html
      {
        "h1. A Solution" => "<h1>A Solution</h1>",
        "I hated wrapping textilize around a string.\n\nIt always felt dirty." =>
          "<p>I hated wrapping textilize around a string.</p>\n<p>It always felt dirty.</p>",
        "I think _this_ is awesome" => "<p>I think <em>this</em> is awesome</p>",
        "Um... _*really*_, man" => "<p>Um&#8230; <em><strong>really</strong></em>, man</p>"
      }.each do |plain, html|
        assert_equal html, plain.to_html
      end
    end

    def test_to_html_lite
      {
        "I have no pee on me" => "I have no pee on me",
        "But I _do_ get Textile!" => "But I <em>do</em> get Textile!"
      }.each do |plain, html|
        assert_equal html, plain.to_html(:lite)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
stringex-2.0.11 test/unit/redcloth_to_html_test.rb
stringex-2.0.10 test/unit/redcloth_to_html_test.rb
stringex-2.0.9 test/unit/redcloth_to_html_test.rb
stringex-2.0.8 test/unit/redcloth_to_html_test.rb
stringex-2.0.7 test/unit/redcloth_to_html_test.rb
stringex-2.0.6 test/unit/redcloth_to_html_test.rb
stringex-2.0.5 test/unit/redcloth_to_html_test.rb
stringex-2.0.4 test/redcloth_to_html_test.rb
stringex-2.0.3 test/redcloth_to_html_test.rb
stringex-2.0.2 test/redcloth_to_html_test.rb
stringex-2.0.1 test/redcloth_to_html_test.rb
stringex-2.0.0 test/redcloth_to_html_test.rb