Sha256: 61e1161cf168c90dd9994e3bd3f8a3e7e52d85fdc38081c394f70f3ccf6b9e92

Contents?: true

Size: 677 Bytes

Versions: 1

Compression:

Stored size: 677 Bytes

Contents

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

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

class TestItemTrackerFile < MiniTest::Unit::TestCase

  def setup
    @website = MiniTest::Mock.new
    @obj = Webgen::ItemTracker::File.new(@website)
  end

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

  def test_item_data
    assert_equal(File.mtime(__FILE__), @obj.item_data(__FILE__))
  end

  def test_changed?
    refute(@obj.changed?(__FILE__, Time.now))
    assert(@obj.changed?(__FILE__, Time.parse("1980-01-01")))
  end

  def test_node_referenced?
    refute(@obj.node_referenced?('anything', 'nothing', '/alcn'))
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webgen-1.0.0.beta1 test/webgen/item_tracker/test_file.rb