Sha256: 26ad6c925b0a88638cd566ad819268a7e997e22468bf538f6440c08c6921546c

Contents?: true

Size: 970 Bytes

Versions: 66

Compression:

Stored size: 970 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

66 entries across 66 versions & 7 rubygems

Version Path
fog-1.22.0 tests/aws/models/cloud_watch/metrics_tests.rb
fog-1.21.0 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/aws/models/cloud_watch/metrics_tests.rb
fog-1.20.0 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/aws/models/cloud_watch/metrics_tests.rb
fog-1.19.0 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/aws/models/cloud_watch/metrics_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/models/cloud_watch/metrics_tests.rb