From 9dbdc392d50bda1ee7c222247cde25f27733b53c Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Mon, 18 Mar 2013 12:49:48 +0100 Subject: [PATCH] [digitalocean|compute] added get_server_details mock code --- .../requests/compute/get_server_details.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/fog/digitalocean/requests/compute/get_server_details.rb b/lib/fog/digitalocean/requests/compute/get_server_details.rb index a14b61fa5..baad87a1e 100644 --- a/lib/fog/digitalocean/requests/compute/get_server_details.rb +++ b/lib/fog/digitalocean/requests/compute/get_server_details.rb @@ -16,7 +16,17 @@ module Fog class Mock def get_server_details(server_id) - Fog::Mock.not_implemented + response = Excon::Response.new + response.status = 200 + + server = self.data[:servers].find { |s| s['id'] == server_id } + + response.body = { + "status" => "OK", + "droplet" => self.data[:servers].find { |s| s['id'] == server_id } + } + + response end end