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