# File lib/fog/compute/ecloud.rb, line 1087 def mock_it(status, mock_data, mock_headers = {}) response = Excon::Response.new #Parse the response body into a hash if mock_data.empty? response.body = mock_data else document = Fog::ToHashDocument.new parser = Nokogiri::XML::SAX::PushParser.new(document) parser << mock_data parser.finish response.body = document.body end response.status = status response.headers = mock_headers response end