1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #9 from irdan/irdan/Delete-Alarm-Coverage

Irdan/delete alarm coverage
This commit is contained in:
irdan 2013-07-26 14:41:02 -07:00
commit 4ebc3182fc
3 changed files with 25 additions and 8 deletions

View file

@ -65,6 +65,7 @@ module Fog
request :update_alarm
request :delete_agent_token
request :delete_alarm
request :delete_check
request :delete_entity

View file

@ -0,0 +1,18 @@
module Fog
module Rackspace
class Monitoring
class Real
def delete_alarm(entity_id, alarm_id)
request(
:expects => [204],
:method => 'DELETE',
:path => "entities/#{entity_id}/alarms/#{alarm_id}"
)
end
end
end
end
end

View file

@ -28,10 +28,9 @@ Shindo.tests('Fog::Rackspace::Monitoring | alarm_tests', ['rackspace','rackspace
tests('#get alarm').formats(LIST_HEADERS_FORMAT) do
account.get_alarm(entity_id,alarm_id).data[:headers]
end
# delete is not currently supported in fog
#tests('#delete alarm').formats(DELETE_DATA_FORMAT) do
#account.delete_alarm(entity_id,check_id).data
#end
tests('#delete alarm').formats(DELETE_DATA_FORMAT) do
account.delete_alarm(entity_id,alarm_id).data
end
end
tests('failure') do
tests('#fail to create new alarm(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
@ -48,10 +47,9 @@ Shindo.tests('Fog::Rackspace::Monitoring | alarm_tests', ['rackspace','rackspace
tests('#fail to get alarm').raises(Fog::Rackspace::Monitoring::NotFound) do
account.get_alarm(-1,-1)
end
# delete is not currently supported in fog
#tests('#fail to delete alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
#account.delete_alarm(-1,-1)
#end
tests('#fail to delete alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
account.delete_alarm(-1,-1)
end
end
account.delete_check(entity_id,check_id)
account.delete_entity(entity_id)