1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

flesh out describe_key_pairs spec

This commit is contained in:
Wesley Beary 2009-07-19 13:53:29 -07:00
parent 89766fb1b2
commit 312386d57a

View file

@ -2,13 +2,30 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe 'EC2.describe_key_pairs' do describe 'EC2.describe_key_pairs' do
before(:all) do
ec2.create_key_pair('key_name')
end
after(:all) do
ec2.delete_key_pair('key_name')
end
it "should return proper attributes with no params" do it "should return proper attributes with no params" do
actual = ec2.describe_key_pairs actual = ec2.describe_key_pairs
actual.body[:key_set].should be_an(Array) actual.body[:key_set].should be_an(Array)
actual.body[:request_id].should be_a(String) actual.body[:request_id].should be_a(String)
p actual key = actual.body[:key_set].select {|key| key[:key_name] == 'key_name' }.first
key[:key_name].should == 'key_name'
key[:key_fingerprint].should be_a(String)
end end
it "should return proper attributes with params" it "should return proper attributes with params" do
actual = ec2.describe_key_pairs(['key_name'])
actual.body[:key_set].should be_an(Array)
actual.body[:request_id].should be_a(String)
key = actual.body[:key_set].select {|key| key[:key_name] == 'key_name' }.first
key[:key_name].should == 'key_name'
key[:key_fingerprint].should be_a(String)
end
end end