Sha256: d23a7627373748724121c3d5fd06629497766c809ec2ef16dc79f6178ed6b168

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 Bytes

Contents

require 'webgen/test'
require 'webgen/node'

class BlockTagTest < Webgen::TagTestCase

  plugin_files [
    'webgen/plugins/tags/block.rb',
    'webgen/plugins/filehandlers/directory.rb',
    'webgen/plugins/filehandlers/page.rb',
  ]
  plugin_to_test 'Tag/Block'


  def test_process_tag
    root = @manager['Core/FileHandler'].instance_eval { build_tree }
    page_node = root.resolve_node('index.en.page')

    assert_equal( ["5 * 3 = 15", [page_node]], @plugin.process_tag( 'block', [page_node] ) )
    assert_equal( ["5 * 3 = 15", [page_node]], @plugin.process_tag( 'block', [page_node, page_node] ) )
    page_node['useERB'] = false
    assert_equal( ["5 * 3 = <%= 5*3 %>", [page_node]], @plugin.process_tag( 'block', [page_node] ) )

    set_config( 'blockName' => 'unknown' )
    assert_equal( '', @plugin.process_tag( 'block', [page_node] ) )
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webgen-0.4.0 test/unittests/tc_tags_block.rb
webgen-0.4.2 test/unittests/tc_tags_block.rb
webgen-0.4.1 test/unittests/tc_tags_block.rb
webgen-0.4.5 test/unittests/tc_tags_block.rb
webgen-0.4.3 test/unittests/tc_tags_block.rb
webgen-0.4.4 test/unittests/tc_tags_block.rb
webgen-0.4.7 test/unittests/tc_tags_block.rb
webgen-0.4.6 test/unittests/tc_tags_block.rb