[vcloud|compute] rather mock Fog::Vcloud::Connection as this is the right place to mock things

This commit is contained in:
Peter Meier 2011-12-21 12:38:42 +01:00
parent cfd96c6cc5
commit f3d97623d4
1 changed files with 11 additions and 13 deletions

View File

@ -1,19 +1,17 @@
module Fog
module Vcloud
class Compute < Fog::Service
class Real
def request(params, &block)
path = File.expand_path(File.join(File.dirname(__FILE__),'..','..','data',params[:path].gsub(/^\//,'').gsub('/','_+_')))
if File.exists?(path)
body = File.read(path)
else
''
end
Excon::Response.new(
:body => body,
:status => 200,
:header => '')
class Fog::Connection
def request(params, &block)
path = File.expand_path(File.join(File.dirname(__FILE__),'..','..','data',params[:path].gsub(/^\//,'').gsub('/','_+_')))
if File.exists?(path)
body = File.read(path)
else
''
end
Excon::Response.new(
:body => body,
:status => 200,
:header => '')
end
end
end