From b473e9c0e00ed5e8bc375ee9ca0d0540911ce70a Mon Sep 17 00:00:00 2001 From: Daniel Reichert Date: Thu, 18 Jul 2013 10:44:38 -0700 Subject: [PATCH] Adding alarm example list, get, and evaluate tests --- .../monitoring/alarm_example_tests.rb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/rackspace/requests/monitoring/alarm_example_tests.rb diff --git a/tests/rackspace/requests/monitoring/alarm_example_tests.rb b/tests/rackspace/requests/monitoring/alarm_example_tests.rb new file mode 100644 index 000000000..bce82709d --- /dev/null +++ b/tests/rackspace/requests/monitoring/alarm_example_tests.rb @@ -0,0 +1,30 @@ +Shindo.tests('Fog::Rackspace::Monitoring | alarm_example_tests', ['rackspace']) do + pending if Fog.mocking? + + account = Fog::Rackspace::Monitoring.new + example_id = "remote.http_body_match_1" + tests('success') do + tests('#list alarm examples').formats(LIST_HEADERS_FORMAT) do + account.list_alarm_examples().data[:headers] + end + tests('#get alarm example').formats(LIST_HEADERS_FORMAT) do + account.get_alarm_example(example_id).data[:headers] + end + tests('#evaluate alarm example').formats(LIST_HEADERS_FORMAT) do + options = { :string => "Foo"} + account.evaluate_alarm_example(example_id,options).data[:headers] + end + end + tests('failure') do + tests('#fail to list alarm examples(-1)').raises(Fog::Rackspace::Monitoring::ArgumentError) do + account.list_alarm_examples(-1).data[:headers] + end + tests('#fail to get alarm example(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do + account.get_alarm_example(-1).data[:headers] + end + tests('#fail to evaluate alarm example').raises(Fog::Rackspace::Monitoring::BadRequest) do + options = { } + account.evaluate_alarm_example(example_id,options).data[:headers] + end + end +end