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-rackspace-0.1.6 tests/rackspace/requests/monitoring/check_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/check_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/check_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.5 tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.4 tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.3 tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.2 tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.1 tests/rackspace/requests/monitoring/check_tests.rb
fog-rackspace-0.1.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.37.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.36.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.35.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-2.0.0.pre.0 tests/rackspace/requests/monitoring/check_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/requests/monitoring/check_tests.rb
fog-1.34.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.33.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.32.0 tests/rackspace/requests/monitoring/check_tests.rb
fog-1.31.0 tests/rackspace/requests/monitoring/check_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/requests/monitoring/check_tests.rb