From 4f01c48a22abcf2e648e18e10a8bfa4acd90ed6d Mon Sep 17 00:00:00 2001 From: Rodrigo Estebanez Date: Tue, 6 Mar 2012 18:39:37 +0100 Subject: [PATCH] [aws][auto_scaling]. Support delete_launch_configuration mocking --- .../auto_scaling/delete_launch_configuration.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb b/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb index 334bc9949..309a3b6d5 100644 --- a/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb +++ b/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb @@ -38,7 +38,16 @@ module Fog class Mock def delete_launch_configuration(launch_configuration_name) - Fog::Mock.not_implemented + unless self.data[:launch_configurations].delete(launch_configuration_name) + raise Fog::AWS::AutoScaling::ValidationError, "Launch configuration name not found - Launch configuration #{launch_configuration_name} not found" + end + + response = Excon::Response.new + response.status = 200 + response.body = { + 'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id } + } + response end end