Sha256: 47b6ca908ba6b5e3c8f4ce7d5978e2fad0691a6b372830d6e16e4d186d26d80f

Contents?: true

Size: 751 Bytes

Versions: 2

Compression:

Stored size: 751 Bytes

Contents

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

require 'test/unit'
require 'webgen/tree'
require 'webgen/contentprocessor'

class TestContentProcessorBuilder < Test::Unit::TestCase

  def test_call
    obj = Webgen::ContentProcessor::Builder.new
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/')
    node = Webgen::Node.new(root, 'test', 'test')
    context = Webgen::ContentProcessor::Context.new(:content => "xml.div(:path => node.absolute_lcn) { xml.strong('test') }",
                                                    :chain => [node])
    assert_equal("<div path=\"/test\">\n  <strong>test</strong>\n</div>\n", obj.call(context).content)

    context.content = 'raise "bla"'
    assert_raise(RuntimeError) { obj.call(context).content }
  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 test/test_contentprocessor_builder.rb
webgen-0.5.7 test/test_contentprocessor_builder.rb