lib/nsisam/fake_client.rb in nsisam-0.7.1 vs lib/nsisam/fake_client.rb in nsisam-0.7.2
- old
+ new
@@ -16,9 +16,13 @@
@storage = {}
@host = host
@port = port
end
+ def download_link_for_file(key)
+ "http://#{@host}:#{@port}/file/#{key}"
+ end
+
def store(data)
key = Time.now.nsec.to_s
@storage[key] = JSON.load(data.to_json) unless @expire
if data.kind_of?(Hash) and data.has_key?(:file) and data.has_key?(:filename)
stub_request(:get, "http://#{@host}:#{@port}/file/#{key}").to_return(body: Base64.decode64(data[:file]))