Sha256: 03714040227cbac4f4d01616a84d6347c807e310cf513c98afde3739f4e0a653

Contents?: true

Size: 726 Bytes

Versions: 7

Compression:

Stored size: 726 Bytes

Contents

require 'test_helper'
require 'aws/ec2'

describe AWS::EC2 do

  before do
    @api = AWS::EC2.new "key", "secret"
  end

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

  it "works with the current version" do
    @api.version.must_equal "2011-11-01"
  end

  describe "API calls" do

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

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

        true
      end

      obj = AWS::EC2.new "key", "secret"
      obj.describe_instances
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_aws-1.0.0 test/aws/ec2_test.rb
simple_aws-1.0.0.pre3 test/aws/ec2_test.rb
simple_aws-1.0.0.pre2 test/aws/ec2_test.rb
simple_aws-1.0.0.pre1 test/aws/ec2_test.rb
simple_aws-0.0.1d test/aws/ec2_test.rb
simple_aws-0.0.1c test/aws/ec2_test.rb
simple_aws-0.0.1b test/aws/ec2_test.rb