Sha256: 94fbb3a662221358e5fca8cf4eff94298d966241b58423ff318189d4681cbb9e

Contents?: true

Size: 888 Bytes

Versions: 2

Compression:

Stored size: 888 Bytes

Contents

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

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

class TestContentProcessorHaml < Test::Unit::TestCase

  def test_call
    obj = Webgen::ContentProcessor::Haml.new
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/')
    node = Webgen::Node.new(root, 'test', 'test')
    content = "#content\n  %h1 Hallo\n  = [context.node.absolute_lcn, context.ref_node.absolute_lcn, context.dest_node.absolute_lcn, context.website, context.dest_node.absolute_lcn].join"
    context = Webgen::Context.new(:content => content,
                                                    :chain => [node])
    obj.call(context)
    assert_equal("<div id='content'>\n  <h1>Hallo</h1>\n  /test/test/test/test\n</div>\n", context.content)

    context.content = "#cont\n  = unknown"
    assert_raise(RuntimeError) { obj.call(context) }
  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.8.20090507 test/test_contentprocessor_haml.rb
webgen-0.5.8 test/test_contentprocessor_haml.rb