Sha256: 4d056a70ea5effa554face59caa229cce505139df12e666ea259612500cb289d

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'
require 'tilt'

begin
  require 'tilt/rst-pandoc'

  class RstPandocTemplateTest < Minitest::Test
    test "is registered for '.rst' files" do
      assert_equal Tilt::RstPandocTemplate, Tilt['test.rst']
    end

    test "compiles and evaluates the template on #render" do
      template = Tilt::RstPandocTemplate.new { |t| "Hello World!\n============" }
      assert_equal "<h1 id=\"hello-world\">Hello World!</h1>", template.render
    end

    test "can be rendered more than once" do
      template = Tilt::RstPandocTemplate.new { |t| "Hello World!\n============" }
      3.times do
        assert_equal "<h1 id=\"hello-world\">Hello World!</h1>", template.render
      end
    end

    test "doens't use markdown options" do
      template = Tilt::RstPandocTemplate.new(:escape_html => true) { |t| "HELLO <blink>WORLD</blink>" }
      err = assert_raises(RuntimeError) { template.render }
      assert_match /pandoc: unrecognized option `--escape-html/, err.message
    end
  end
rescue LoadError => boom
  warn "Tilt::RstPandocTemplate (disabled) [#{boom}]"
end

Version data entries

20 entries across 20 versions & 6 rubygems

Version Path
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.4.1 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.4.0 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.3.5 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.3.4 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.3.3 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.3.2 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
brakeman-3.3.1 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb
tilt-2.0.5 test/tilt_rstpandoctemplate_test.rb