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.1.0 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.100 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.99 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.98 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.97 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.96 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.95 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.94 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.93 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.92 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.91 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.90 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.89 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.88 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.87 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.86 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.85 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.84 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.83 spec/aws/requests/ec2/create_key_pair_spec.rb
fog-0.0.82 spec/aws/requests/ec2/create_key_pair_spec.rb