Sha256: b497682d5fa3c3689166251033ba3382fbf03c0f2b1a7c57c40d2e7ca2f1c304

Contents?: true

Size: 851 Bytes

Versions: 5

Compression:

Stored size: 851 Bytes

Contents

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

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

class TestTagMetainfo < Test::Unit::TestCase

  include Test::WebsiteHelper

  def test_call
    @obj = Webgen::Tag::Metainfo.new
    node = Webgen::Node.new(Webgen::Tree.new.dummy_root, 'hallo.page', 'hallo.page', 'test' => 10, 'lang' => 'en',
                            'bad' => 'Something <&>" Bad')
    c = Webgen::Context.new(:chain => [node])
    assert_equal('', @obj.call('invalid', '', c))
    assert_equal('10', @obj.call('test', '', c))
    assert_equal('en', @obj.call('lang', '', c))
    assert_equal('Something &lt;&amp;&gt;&quot; Bad', @obj.call('bad', '', c))
    @obj.set_params('tag.metainfo.escape_html' => false)
    assert_equal('Something <&>" Bad', @obj.call('bad', '', c))
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webgen-0.5.17 test/test_tag_metainfo.rb
webgen-0.5.15 test/test_tag_metainfo.rb
webgen-0.5.14 test/test_tag_metainfo.rb
webgen-0.5.13 test/test_tag_metainfo.rb
webgen-0.5.12 test/test_tag_metainfo.rb