Sha256: 567aee5335d0a4e031588cd207108de8e8f38f4683d2df6c0f4d27e5ce39e8b5

Contents?: true

Size: 960 Bytes

Versions: 79

Compression:

Stored size: 960 Bytes

Contents

Shindo.tests("AWS::CloudWatch | metrics", ['aws', 'cloudwatch']) do

  tests('success') do
    pending # FIXME: the hardcoded instance id won't be available
    tests("#all").succeeds do
      Fog::AWS[:cloud_watch].metrics.all
    end
    instanceId = 'i-fd713391'
    metricName = 'CPUUtilization'
    namespace = 'AWS/EC2'
    tests("#get").returns({:dimensions=>[{"Name"=>"InstanceId", "Value"=>instanceId}], :name=>metricName, :namespace=>namespace}) do
      Fog::AWS[:cloud_watch].metrics.get(namespace, metricName, {'InstanceId' => instanceId}).attributes
    end

  end

  tests('#each') do
    Fog.mock!
    tests("handle NextToken").returns(1001) do
      count = 0
      Fog::AWS[:cloud_watch].metrics.each {|e| count += 1 }
      count
    end

    tests("yields Metrics instances").succeeds do
      all = []
      Fog::AWS[:cloud_watch].metrics.each {|e| all << e }
      all.all? {|e| e.is_a?(Fog::AWS::CloudWatch::Metric) }
    end
  end

end

Version data entries

79 entries across 77 versions & 6 rubygems

Version Path
fog-aws-0.9.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.8.1 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.8.0 tests/models/cloud_watch/metrics_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-aws-0.7.5/tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.7.6 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.7.5 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.7.4 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.7.3 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.7.2 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.6.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.5.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.4.1 tests/models/cloud_watch/metrics_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/aws/models/cloud_watch/metrics_tests.rb
fog-aws-0.4.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.3.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.2.2 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.2.0 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.1.2 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.1.1 tests/models/cloud_watch/metrics_tests.rb
fog-aws-0.1.0 tests/models/cloud_watch/metrics_tests.rb