Sha256: 9ecfd2cc845c1c1a6791e437b2c35c767be3bc34074506454d5dc4160683f941

Contents?: true

Size: 809 Bytes

Versions: 5

Compression:

Stored size: 809 Bytes

Contents

require 'test_helper'
require 'simple_aws/cloud_watch'

describe SimpleAWS::CloudWatch do

  before do
    @api = SimpleAWS::CloudWatch.new "key", "secret"
  end

  it "points to endpoint, default to us-east-1" do
    @api.uri.must_equal "https://monitoring.us-east-1.amazonaws.com"
  end

  it "works with the current version" do
    @api.version.must_equal "2010-08-01"
  end

  describe "API calls" do

    it "builds and signs calls with ActionParam rules" do
      SimpleAWS::Connection.any_instance.expects(:call).with do |request|
        params = request.params
        params.wont_be_nil

        params["Action"].must_equal "ListMetrics"
        params["Signature"].wont_be_nil

        true
      end

      obj = SimpleAWS::CloudWatch.new "key", "secret"
      obj.list_metrics
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_aws-1.2.3 test/simple_aws/cloud_watch_test.rb
simple_aws-1.2.2 test/simple_aws/cloud_watch_test.rb
simple_aws-1.2.1 test/simple_aws/cloud_watch_test.rb
simple_aws-1.2.0 test/simple_aws/cloud_watch_test.rb
simple_aws-1.1.0 test/simple_aws/cloud_watch_test.rb