Sha256: 868c181f60e2d6bf5e83a35582a356e37d0edb0628fc2c9244cff70c31472e86

Contents?: true

Size: 888 Bytes

Versions: 3

Compression:

Stored size: 888 Bytes

Contents

require 'test_helper'
require 'simple_aws/iam'

describe SimpleAWS::IAM do

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

  it "points to the endpoint" do
    @api.uri.must_equal "https://iam.amazonaws.com"
  end

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

  it "does not support region selection" do
    lambda {
      SimpleAWS::IAM.new "key", "secret", "us-east-1"
    }.must_raise ArgumentError
  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 "GetGroup"
        params["Signature"].wont_be_nil

        true
      end

      obj = SimpleAWS::IAM.new "key", "secret"
      obj.get_group
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_aws-1.2.3 test/simple_aws/iam_test.rb
simple_aws-1.2.2 test/simple_aws/iam_test.rb
simple_aws-1.2.1 test/simple_aws/iam_test.rb