Sha256: e8827938be42c0ee4f2b672b635c5ad9147af12b87974d9c34047adcd8f16a91

Contents?: true

Size: 1.47 KB

Versions: 79

Compression:

Stored size: 1.47 KB

Contents

Shindo.tests('Fog::Rackspace::Monitoring | check_tests', ['rackspace', 'rackspace_monitoring']) do

  account = Fog::Rackspace::Monitoring.new
  entity_id = account.create_entity(:label => "Foo").data[:headers]["X-Object-ID"]
  check_id = nil
  tests('success') do
    tests('#create new check').formats(DATA_FORMAT) do
      response = account.create_check(entity_id, CHECK_CREATE_OPTIONS).data
      check_id = response[:headers]['X-Object-ID']
      response
    end
    tests('#get check').formats(LIST_HEADERS_FORMAT) do
      account.get_check(entity_id,check_id).data[:headers]
    end
    tests('#update check').formats(DATA_FORMAT) do
      options = { :label => "Bar"}
      account.update_check(entity_id,check_id,options).data
    end
    tests('#delete check').formats(DELETE_DATA_FORMAT) do
      account.delete_check(entity_id,check_id).data
    end
  end
  tests('failure') do
    tests('#create new check(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
      account.create_check(entity_id, {:type => ""})
    end
    tests('#get check(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      account.get_check(-1, -1)
    end
    tests('#update invalid check(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      options = { :testing => "Bar" }
      response = account.update_check(-1,-1,options)
    end
    tests('#delete check(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      account.delete_check(-1,-1)
    end
  end
  account.delete_entity(entity_id)
end

Version data entries

79 entries across 77 versions & 7 rubygems

Version Path
fog-maestrodev-1.18.0.20131206115947 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131121075022 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.18.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.17.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.16.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/rackspace/requests/monitoring/check_tests.rb