You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
358 B
22 lines
358 B
12 years ago
|
class Cask::FakeFetcher
|
||
|
def self.fake_response_for(url, response)
|
||
|
@responses[url] = response
|
||
|
end
|
||
|
|
||
|
def self.head(url)
|
||
|
@responses ||= {}
|
||
|
unless @responses.key?(url)
|
||
|
fail("no response faked for #{url.inspect}")
|
||
|
end
|
||
|
@responses[url]
|
||
|
end
|
||
|
|
||
|
def self.init
|
||
|
@responses = {}
|
||
|
end
|
||
|
|
||
|
def self.clear
|
||
|
@responses = {}
|
||
|
end
|
||
|
end
|