Sha256: 6d4512e40b335efd2bafc5d6455c1ddb4802bf86b1701fab4aeaa0b4bd13163c

Contents?: true

Size: 939 Bytes

Versions: 5

Compression:

Stored size: 939 Bytes

Contents

require 'test_helper'
require 'simple_aws/import_export'

describe SimpleAWS::ImportExport do

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

  it "does not support region selection" do
    lambda {
      SimpleAWS::ImportExport.new "key", "secret", "us-east-1"
    }.must_raise ArgumentError
  end

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

  it "works with the current version" do
    @api.version.must_equal "2010-06-03"
  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 "ListJobs"
        params["Signature"].wont_be_nil

        true
      end

      obj = SimpleAWS::ImportExport.new "key", "secret"
      obj.list_jobs
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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