mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Test timestamp option when getting file list
This commit is contained in:
parent
fa366c14a9
commit
450ae2e8d6
@ -3,10 +3,15 @@ require 'pry-rescue/minitest'
|
||||
require 'wayback_machine_downloader'
|
||||
|
||||
|
||||
class WaybackMachineDownloaderTest < Minitest::Test
|
||||
class WaybackMachineDownloaderTest < Minitest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@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
|
||||
|
||||
def test_base_url_being_set
|
||||
@ -19,6 +24,13 @@ class WaybackMachineDownloaderTest < Minitest::Test
|
||||
|
||||
def test_file_download
|
||||
@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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user