Sha256: d8ce46b554a4ae651b47858eaf31b4837e9d288b4ef39605a654d248630078ff
Contents?: true
Size: 724 Bytes
Versions: 11
Compression:
Stored size: 724 Bytes
Contents
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
11 entries across 11 versions & 2 rubygems