mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fixed models and added tests
This commit is contained in:
parent
9c55b55111
commit
ba8e072e14
3 changed files with 23 additions and 2 deletions
|
@ -37,7 +37,7 @@ module Fog
|
|||
requires :threshold
|
||||
|
||||
alarm_definition = {
|
||||
'AlarnName' => alarm_name,
|
||||
'AlarmName' => alarm_name,
|
||||
'ComparisonOperator' => comparison_operator,
|
||||
'EvaluationPeriods' => evaluation_periods,
|
||||
'MetricName' => metric_name,
|
||||
|
|
|
@ -10,7 +10,7 @@ module Fog
|
|||
|
||||
#alarm_names is an array of alarm names
|
||||
def delete(alarm_names)
|
||||
connection.list_metrics(alarm_names)
|
||||
connection.delete_alarms(alarm_names)
|
||||
true
|
||||
end
|
||||
|
||||
|
|
21
tests/aws/models/cloud_watch/alarm_history_tests.rb
Normal file
21
tests/aws/models/cloud_watch/alarm_history_tests.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
Shindo.tests("AWS::CloudWatch | alarm_histories", ['aws', 'cloudwatch']) do
|
||||
|
||||
tests('success') do
|
||||
pending
|
||||
tests("#all").succeeds do
|
||||
Fog::AWS[:cloud_watch].alarm_histories.all
|
||||
end
|
||||
|
||||
new_attributes = {
|
||||
:alarm_name => 'tmp-alarm',
|
||||
:end_date => '',
|
||||
:history_item_type => 'StateUpdate',
|
||||
:max_records => 1,
|
||||
:start_date => ''
|
||||
}
|
||||
tests('#new').returns(new_attributes) do
|
||||
Fog::AWS[:cloud_watch].alarm_histories.new(new_attributes).attributes
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue