Sha256: ba6b932301cb25fad5af6a6a4741aefe51aaa7b2ea04d9c4fb9f98c352467ade

Contents?: true

Size: 651 Bytes

Versions: 11

Compression:

Stored size: 651 Bytes

Contents

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

class TestContentProcessorErb < Test::Unit::TestCase

  def test_call
    obj = Webgen::ContentProcessor::Erb.new
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/')
    node = Webgen::Node.new(root, 'test', 'test')
    context = Webgen::ContentProcessor::Context.new(:content => '<%= context[:doit] %>6', :doit => 'hallo',
                                                    :chain => [node])
    obj.call(context)
    assert_equal('hallo6', context.content)

    context.content = '<%= 5* %>'
    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_erb.rb
gettalong-webgen-0.5.5.20081001 test/test_contentprocessor_erb.rb
gettalong-webgen-0.5.5.20081010 test/test_contentprocessor_erb.rb
gettalong-webgen-0.5.5.20081012 test/test_contentprocessor_erb.rb
gettalong-webgen-0.5.6.20081020 test/test_contentprocessor_erb.rb
webgen-0.5.1 test/test_contentprocessor_erb.rb
webgen-0.5.2 test/test_contentprocessor_erb.rb
webgen-0.5.3 test/test_contentprocessor_erb.rb
webgen-0.5.4 test/test_contentprocessor_erb.rb
webgen-0.5.5 test/test_contentprocessor_erb.rb
webgen-0.5.6 test/test_contentprocessor_erb.rb