Sha256: d18719abc32f64278bbc43ba989d3b260ab580e7a9e976864ac681bcaef1fc17

Contents?: true

Size: 971 Bytes

Versions: 3

Compression:

Stored size: 971 Bytes

Contents

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

require 'webgen/test_helper'
require 'webgen/content_processor/xmllint'

class TestXmllint < MiniTest::Unit::TestCase

  include Webgen::TestHelper

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

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

    @context.content = data = 'test'
    assert_equal(data, cp.call(@context).content)
    assert_log_match(/<\/test:~1>/)

    @context.content = data = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
      '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>title</title></head><body></body></html>'
    assert_equal(data, 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_xmllint.rb
webgen-1.0.0.beta2 test/webgen/content_processor/test_xmllint.rb
webgen-1.0.0.beta1 test/webgen/content_processor/test_xmllint.rb