In-line sanity checks, written as extensions to core Ruby objects. See API listing below, or browse the full documentation.
require "json"
require "pathname"
path = Pathname.new("hosted_files.json").assert!(&:exist?)
hosted_files = JSON.parse(path.read).assert!(Array)
urls = hosted_files.flat_map do |file_info|
file_info.fetch("mirror_urls").refute!(&:empty?)
end
domains = urls.map do |url|
url.assert!(%r"^https?://").split("/")[2]
end.uniq"mini_sanity/assert""mini_sanity/change""mini_sanity/match""mini_sanity/results"
Install the mini_sanity gem.
Run rake test to run the tests.