Sha256: 5bf3526e356e3245c8a9774e95c093f806abaeaf7352a7200f1ef322bd34b046

Contents?: true

Size: 683 Bytes

Versions: 14

Compression:

Stored size: 683 Bytes

Contents

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

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

class TestItemTrackerFile < Minitest::Test

  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_item_changed?
    refute(@obj.item_changed?(__FILE__, Time.now))
    assert(@obj.item_changed?(__FILE__, Time.parse("1980-01-01")))
  end

  def test_referenced_nodes
    assert_equal([], @obj.referenced_nodes('anything', 'nothing'))
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

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