Sha256: 20de17ee3fef3a187a315f52252fc73997994046db6a46e66de7888bf3d7ad11

Contents?: true

Size: 916 Bytes

Versions: 15

Compression:

Stored size: 916 Bytes

Contents

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

require 'minitest/autorun'
require 'time'
require 'webgen/item_tracker/template_chain'

class TestItemTrackerTemplateChain < Minitest::Test

  def setup
    @website = Object.new
    @node = node = Object.new
    @node.define_singleton_method(:alcn) { 'alcn' }
    @node.define_singleton_method(:template_chain) { [node] }
    @website.define_singleton_method(:tree) { {'alcn' => node} }
    @obj = Webgen::ItemTracker::TemplateChain.new(@website)
  end

  def test_item_id
    assert_equal('alcn', @obj.item_id(@node))
  end

  def test_item_data
    assert_equal(['alcn'], @obj.item_data('alcn'))
  end

  def test_item_changed?
    assert(@obj.item_changed?('unknown', 'old'))
    assert(@obj.item_changed?('alcn', ['old']))
    refute(@obj.item_changed?('alcn', ['alcn']))
  end

  def test_referenced_nodes
    assert_equal(['alcn'], @obj.referenced_nodes('alcn', 'data'))
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webgen-1.7.3 test/webgen/item_tracker/test_template_chain.rb
webgen-1.7.2 test/webgen/item_tracker/test_template_chain.rb
webgen-1.7.1 test/webgen/item_tracker/test_template_chain.rb
webgen-1.7.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.6.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.5.2 test/webgen/item_tracker/test_template_chain.rb
webgen-1.5.1 test/webgen/item_tracker/test_template_chain.rb
webgen-1.5.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.4.1 test/webgen/item_tracker/test_template_chain.rb
webgen-1.4.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.3.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.2.1 test/webgen/item_tracker/test_template_chain.rb
webgen-1.2.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.1.0 test/webgen/item_tracker/test_template_chain.rb
webgen-1.0.0 test/webgen/item_tracker/test_template_chain.rb