diff --git a/test/test_wayback_machinve_downloader.rb b/test/test_wayback_machinve_downloader.rb index 0714a37..cacdf37 100644 --- a/test/test_wayback_machinve_downloader.rb +++ b/test/test_wayback_machinve_downloader.rb @@ -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