Sha256: f14bc810e66d0369069edc683c99a918057d44179f8a21f0e3a1ec0c04603ebd

Contents?: true

Size: 795 Bytes

Versions: 3

Compression:

Stored size: 795 Bytes

Contents

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

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

class TestTagCoderay < Test::Unit::TestCase

  include Test::WebsiteHelper

  def setup
    super
    @obj = Webgen::Tag::Coderay.new
  end

  def call(context, body, lang, process)
    @obj.set_params({'tag.coderay.lang' => lang,
                      'tag.coderay.process' => process})
    result = @obj.call('coderay', body, context)
    @obj.set_params({})
    result
  end

  def test_call
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/', {'title' => 'Hallo'})
    context = Webgen::ContentProcessor::Context.new(:chain => [root])

    assert(call(context, 'TestData', 'html', false).include?('TestData'))
    assert(call(context, '{title:}', :ruby, true).include?('Hallo'))
  end

end

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 test/test_tag_coderay.rb
thewoolleyman-webgen-0.5.8.20090419 test/test_tag_coderay.rb
webgen-0.5.7 test/test_tag_coderay.rb