Sha256: 607e009eb981330e620094b1bec7ea28c7d8840a7fd2fb7c2140ba79b795836e

Contents?: true

Size: 997 Bytes

Versions: 41

Compression:

Stored size: 997 Bytes

Contents

require "helpers/integration_test_helper"

class TestMetricDescriptors < FogIntegrationTest
  def setup
    @client = Fog::Google::Monitoring.new
  end

  def test_list_and_get
    resp = @client.list_monitored_resource_descriptors

    assert_operator(resp.resource_descriptors.size, :>, 0,
                    "resource descriptor count should be positive")

    @client.get_monitored_resource_descriptor(
      resp.resource_descriptors.first.type
    )
  end

  def test_all
    resp = @client.monitored_resource_descriptors.all

    assert_operator(resp.size, :>, 0,
                    "resource descriptor count should be positive")
  end

  def test_get
    resource = "global"
    descriptor = @client.monitored_resource_descriptors.get(resource)

    assert_equal(
      descriptor.name,
      "projects/#{@client.project}/monitoredResourceDescriptors/#{resource}"
    )
    assert_equal(descriptor.labels.size, 1)
    assert_equal(descriptor.labels.first[:key], "project_id")
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
fog-google-1.24.1 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.24.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.23.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.22.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.21.1 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.21.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.20.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.19.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.18.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.17.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.16.1 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.16.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.15.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.14.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
gitlab-fog-google-1.14.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.13.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
gitlab-fog-google-1.13.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.12.1 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.12.0 test/integration/monitoring/test_monitored_resource_descriptors.rb
fog-google-1.11.0 test/integration/monitoring/test_monitored_resource_descriptors.rb