Sha256: 55a4175e1af1852ff29cfa3eb68bb9711b56093733c8625eeacb594e7b566fbb
Contents?: true
Size: 898 Bytes
Versions: 7
Compression:
Stored size: 898 Bytes
Contents
# -*- encoding: utf-8 -*- require 'webgen/test_helper' require 'webgen/content_processor/tags' require 'webgen/utils/tag_parser' class TestContentProcessorTags < Minitest::Test include Webgen::TestHelper class SimpleTag def set_block(&block) @block = block end def call(tag, params, body, context) @block.call(tag, params, body, context) end def replace_tags(content, &block) Webgen::Utils::TagParser.new.replace_tags(content, &block) end end def test_static_call setup_context cp = Webgen::ContentProcessor::Tags @context.content = '{test: }' stag = SimpleTag.new @website.ext.tag = stag stag.set_block do |tag, params, body, local_context| assert_equal('test', tag) assert_nil(params) assert_equal('', body) assert_equal(@context, local_context) end cp.call(@context) end end
Version data entries
7 entries across 7 versions & 1 rubygems