Sha256: 452323374a217de054009e2ca29c8d377434f0537dd624f4f0359d5139349a39

Contents?: true

Size: 876 Bytes

Versions: 3

Compression:

Stored size: 876 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/test_helper'
require 'webgen/content_processor/tidy'

class TestTidy < MiniTest::Unit::TestCase

  include Webgen::TestHelper

  def test_static_call
    setup_context
    @website.config['content_processor.tidy.options'] = ''
    cp = Webgen::ContentProcessor::Tidy

    begin
      tmp, ENV['PATH'] = ENV['PATH'], '/sbin'
      assert_raises(Webgen::CommandNotFoundError) { cp.call(@context) }
    ensure
      ENV['PATH'] = tmp
    end

    @context.content = "testcontent"
    assert_match(/html.*testcontent/im, cp.call(@context).content)
    assert_log_match(/inserting missing/)

    @context.content = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>t</title></head><body>b</body></html'
    assert_match(/body.*b.*body/im, cp.call(@context).content)
    assert_equal(0, @logio.string.length)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webgen-1.0.0.beta3 test/webgen/content_processor/test_tidy.rb
webgen-1.0.0.beta2 test/webgen/content_processor/test_tidy.rb
webgen-1.0.0.beta1 test/webgen/content_processor/test_tidy.rb