From 79f240f373ebf98c76978b67df7022d26470c664 Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Mon, 18 Mar 2013 12:52:10 +0100 Subject: [PATCH] [digitalocean|compute] added power_off_server mock code --- .../digitalocean/requests/compute/power_off_server.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/fog/digitalocean/requests/compute/power_off_server.rb b/lib/fog/digitalocean/requests/compute/power_off_server.rb index 001ddd5da..ac096eb82 100644 --- a/lib/fog/digitalocean/requests/compute/power_off_server.rb +++ b/lib/fog/digitalocean/requests/compute/power_off_server.rb @@ -16,7 +16,15 @@ module Fog class Mock def power_off_server( id ) - Fog::Mock.not_implemented + response = Excon::Response.new + response.status = 200 + server = self.data[:servers].find { |s| s['id'] } + server['status'] = 'off' if server + response.body = { + "event_id" => Fog::Mock.random_numbers(1).to_i, + "status" => "OK" + } + response end end