Sha256: 6597f1777794994d02b08ea9eede5bfcbea46560abf28938ebd1f66bec684043

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

require 'test_helper'
require 'simple_aws/ec2'

describe SimpleAWS::EC2 do

  before do
    @api = SimpleAWS::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
      SimpleAWS::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 = SimpleAWS::EC2.new "key", "secret"
      obj.describe_instances
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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