Sha256: 49a226352b8f1a2cecaaefd236b82c326d23f194a11e65c62f510242c718575f

Contents?: true

Size: 653 Bytes

Versions: 5

Compression:

Stored size: 653 Bytes

Contents

# coding: UTF-8
require 'test_helper'

class CustomRenderTest < Greenmat::TestCase
  class SimpleRender < Greenmat::Render::HTML
    def emphasis(text)
      "<em class=\"cool\">#{text}</em>"
    end
  end

  def test_simple_overload
    md = Greenmat::Markdown.new(SimpleRender)
    html_equal "<p>This is <em class=\"cool\">just</em> a test</p>\n",
      md.render("This is *just* a test")
  end

  class NilPreprocessRenderer < Greenmat::Render::HTML
    def preprocess(fulldoc)
      nil
    end
  end

  def test_preprocess_returning_nil
    md = Greenmat::Markdown.new(NilPreprocessRenderer)
    assert_equal(nil,md.render("Anything"))
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
greenmat-3.2.2.4 test/custom_render_test.rb
greenmat-3.2.2.3 test/custom_render_test.rb
greenmat-3.2.2.2 test/custom_render_test.rb
greenmat-3.2.2.1 test/custom_render_test.rb
greenmat-3.2.2.0 test/custom_render_test.rb