Sha256: 080163ec36b5d0ddc8755b6e107cf093c0a6f71468fb5693aa7ce7e08dd32cb8

Contents?: true

Size: 989 Bytes

Versions: 6

Compression:

Stored size: 989 Bytes

Contents

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

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

class TestContentProcessor < Test::Unit::TestCase

  include Test::WebsiteHelper

  def setup
    super
    @website.config.data['contentprocessor.map'] = {'test' => 'Hash', 'binary' => ['Hash', :binary]}
  end

  def test_access_hash
    ah = Webgen::ContentProcessor::AccessHash.new
    assert(ah.has_key?('test'))
    assert(!ah.has_key?('other'))
    assert_kind_of(Hash, ah['test'])
    assert_nil(ah['other'])
  end

  def test_list
    assert_equal(['binary', 'test'], Webgen::ContentProcessor.list.sort)
  end

  def test_for_name
    assert_kind_of(Hash, Webgen::ContentProcessor.for_name('test'))
    assert_kind_of(Hash, Webgen::ContentProcessor.for_name('binary'))
    assert_nil(Webgen::ContentProcessor.for_name('other'))
  end

  def test_is_binary
    assert(!Webgen::ContentProcessor.is_binary?('test'))
    assert(Webgen::ContentProcessor.is_binary?('binary'))
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

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