Sha256: daa2eea174fe2d0b5bd2de8f3c1e8b894e9c1b772be61f55a485b145719f9284

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

Shindo.tests('Fog::Rackspace::Monitoring | entity_tests', ['rackspace','rackspace_monitoring']) do
  pending if Fog.mocking? 
  account = Fog::Rackspace::Monitoring.new
  entity_id = nil
  tests('success') do
    tests('#create new entity').formats(DATA_FORMAT) do
      response = account.create_entity(:label => "Foo").data
      entity_id = response[:headers]["X-Object-ID"]
      response
    end
    tests('#get entity').formats(LIST_HEADERS_FORMAT) do
      account.get_entity(entity_id).data[:headers]
    end
    tests('#update entity').formats(DATA_FORMAT) do
      options = { :testing => "Bar"}
      account.update_entity(entity_id,options).data
    end
    tests('#delete entity').formats(DELETE_DATA_FORMAT) do
      account.delete_entity(entity_id).data
    end
  end
  tests('failure') do
    tests('#create new entity(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
      account.create_entity(:label => "")
    end
    tests('#get entity(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      account.get_entity(-1)
    end
    tests('#update invalid entity(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      options = { :testing => "Bar" }
      response = account.update_entity(-1,options)
    end
    tests('#delete entity(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      account.delete_entity(-1)
    end
  end
end

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
fog-1.15.0 tests/rackspace/requests/monitoring/entity_tests.rb
gapinc-fog-1.14.0 tests/rackspace/requests/monitoring/entity_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/rackspace/requests/monitoring/entity_tests.rb