Sha256: e83736f8095038ce8d85c14b5f440614bba81a33d147bf33cfc78fd056892725

Contents?: true

Size: 715 Bytes

Versions: 11

Compression:

Stored size: 715 Bytes

Contents

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')
    context = Webgen::ContentProcessor::Context.new(:content => "#content\n  %h1 Hallo\n  = node.absolute_lcn",
                                                    :chain => [node])
    obj.call(context)
    assert_equal("<div id='content'>\n  <h1>Hallo</h1>\n  /test\n</div>\n", context.content)

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

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 test/test_contentprocessor_haml.rb
gettalong-webgen-0.5.5.20081001 test/test_contentprocessor_haml.rb
gettalong-webgen-0.5.5.20081010 test/test_contentprocessor_haml.rb
gettalong-webgen-0.5.5.20081012 test/test_contentprocessor_haml.rb
gettalong-webgen-0.5.6.20081020 test/test_contentprocessor_haml.rb
webgen-0.5.2 test/test_contentprocessor_haml.rb
webgen-0.5.4 test/test_contentprocessor_haml.rb
webgen-0.5.1 test/test_contentprocessor_haml.rb
webgen-0.5.3 test/test_contentprocessor_haml.rb
webgen-0.5.6 test/test_contentprocessor_haml.rb
webgen-0.5.5 test/test_contentprocessor_haml.rb