added new option for regex acceptance you dont have to download entire site when looking for specific path

This commit is contained in:
Gil Cohen
2015-11-06 13:11:26 -05:00
parent ed7948a372
commit 432ca1d5b5
3 changed files with 41 additions and 4 deletions

View File

@@ -30,6 +30,16 @@ class WaybackMachineDownloaderTest < Minitest::Test
assert_equal file_expected, @wayback_machine_downloader.get_file_list_by_timestamp[-1]
end
def test_file_list_notthere_regex
regextester = WaybackMachineDownloader.new base_url: 'http://www.onlyfreegames.net', accept_regex: 'abc123'
assert_equal 0, regextester.get_file_list_curated.length
end
def test_file_list_singleresult_regex
regextester = WaybackMachineDownloader.new base_url: 'http://www.onlyfreegames.net', accept_regex: 'menu.html$'
assert_equal 1, regextester.get_file_list_curated.length
end
def test_file_download
@wayback_machine_downloader.download_files
linux_page = open 'websites/www.onlyfreegames.net/linux.htm'