Sha256: fe817963eeb0f0c397c2a9ce4982002d496611d2589078b28ba7b72a621c0da8

Contents?: true

Size: 908 Bytes

Versions: 61

Compression:

Stored size: 908 Bytes

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'

describe 'EC2.create_key_pair' do
  describe 'success' do

    after(:each) do
      AWS[:ec2].delete_key_pair('fog_key_pair')
    end

    it "should return proper attributes" do
      actual = AWS[:ec2].create_key_pair('fog_key_pair')
      actual.body['keyFingerprint'].should be_a(String)
      actual.body['keyMaterial'].should be_a(String)
      actual.body['keyName'].should be_a(String)
      actual.body['requestId'].should be_a(String)
    end

  end
  describe 'failure' do

    before(:each) do
      AWS[:ec2].create_key_pair('fog_key_pair')
    end

    after(:each) do
      AWS[:ec2].delete_key_pair('fog_key_pair')
    end

    it "should raise a BadRequest when the key pair already exists" do
      lambda {
        AWS[:ec2].create_key_pair('fog_key_pair')
      }.should raise_error(Excon::Errors::BadRequest)
    end

  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
fog-0.0.61 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.60 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.59 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.58 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.57 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.56 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.55 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.54 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.53 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.52 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.51 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.50 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.49 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.48 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.47 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.46 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.45 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.44 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.43 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.42 spec/aws/requests/ec2/create_key_pair_spec.rb