Add test for file list retrieval and file list download

This commit is contained in:
hartator
2015-08-08 16:15:38 -05:00
parent 0d970b87bb
commit 1c1266e464

View File

@@ -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