sources: rename Sources::Strategies to Source::Extractor.

Rename Sources::Strategies to Source::Extractor. A Source::Extractor
represents a thing that extracts information from a given URL.
This commit is contained in:
evazion
2022-03-24 03:05:10 -05:00
parent 34aa22f90b
commit d9d3c1dfe4
63 changed files with 622 additions and 606 deletions

View File

@@ -1,12 +1,12 @@
module DownloadTestHelper
def assert_downloaded(expected_filesize, source, referer = nil)
strategy = Sources::Strategies.find(source, referer)
strategy = Source::Extractor.find(source, referer)
file = strategy.download_file!(strategy.image_urls.sole)
assert_equal(expected_filesize, file.size, "Tested source URL: #{source}")
end
def assert_rewritten(expected_source, test_source, test_referer = nil)
strategy = Sources::Strategies.find(test_source, test_referer)
strategy = Source::Extractor.find(test_source, test_referer)
rewritten_source = strategy.image_urls.sole
assert_match(expected_source, rewritten_source, "Tested source URL: #{test_source}")
end