From 1c1266e4640e522144aead53134ae2a0605e9954 Mon Sep 17 00:00:00 2001 From: hartator Date: Sat, 8 Aug 2015 16:15:38 -0500 Subject: [PATCH] Add test for file list retrieval and file list download --- test/test_wayback_machinve_downloader.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/test_wayback_machinve_downloader.rb b/test/test_wayback_machinve_downloader.rb index f68f067..77db918 100644 --- a/test/test_wayback_machinve_downloader.rb +++ b/test/test_wayback_machinve_downloader.rb @@ -1,8 +1,24 @@ require 'minitest/autorun' +require 'pry-rescue/minitest' require 'wayback_machine_downloader' + class WaybackMachineDownloaderTest < Minitest::Test - def test_english_hello - assert_equal "Hello world! John", WaybackMachineDownloader.hi("John") + + def setup + @wayback_machine_downloader = WaybackMachineDownloader.new base_url: 'http://www.onlyfreegames.net' end + + def test_base_url_being_set + assert_equal 'http://www.onlyfreegames.net', @wayback_machine_downloader.base_url + end + + def test_file_list_curated + assert_equal 20081120203712, @wayback_machine_downloader.file_list_curated["linux.htm"][:timestamp] + end + + def test_file_download + @wayback_machine_downloader.download_files + end + end