Test timestamp option when getting file list

This commit is contained in:
hartator 2015-08-09 22:34:01 -05:00
parent fa366c14a9
commit 450ae2e8d6

View File

@ -3,10 +3,15 @@ require 'pry-rescue/minitest'
require 'wayback_machine_downloader' require 'wayback_machine_downloader'
class WaybackMachineDownloaderTest < Minitest::Test class WaybackMachineDownloaderTest < Minitest::Unit::TestCase
def setup def setup
@wayback_machine_downloader = WaybackMachineDownloader.new base_url: 'http://www.onlyfreegames.net' @wayback_machine_downloader = WaybackMachineDownloader.new base_url: 'http://www.onlyfreegames.net'
$stdout = StringIO.new
end
def teardown
FileUtils.rm_rf(@wayback_machine_downloader.backup_path)
end end
def test_base_url_being_set def test_base_url_being_set
@ -19,6 +24,13 @@ class WaybackMachineDownloaderTest < Minitest::Test
def test_file_download def test_file_download
@wayback_machine_downloader.download_files @wayback_machine_downloader.download_files
linux_page = open 'websites/www.onlyfreegames.net/linux.htm'
assert_includes linux_page.read, "Linux Games"
end
def test_timestamp_being_respected
@wayback_machine_downloader.timestamp = 20050716231334
assert_nil @wayback_machine_downloader.get_file_list_curated["linux.htm"]
end end
end end