test/test_EC2_keypairs.rb in amazon-ec2-0.2.15 vs test/test_EC2_keypairs.rb in amazon-ec2-0.3.1

- old
+ new

@@ -1,13 +1,13 @@ #-- # Amazon Web Services EC2 Query API Ruby library # # Ruby Gem Name:: amazon-ec2 -# Author:: Glenn Rempe (mailto:grempe@rubyforge.org) +# Author:: Glenn Rempe (mailto:glenn@rempe.us) # Copyright:: Copyright (c) 2007-2008 Glenn Rempe # License:: Distributes under the same terms as Ruby -# Home:: http://amazon-ec2.rubyforge.org +# Home:: http://github.com/grempe/amazon-ec2/tree/master #++ require File.dirname(__FILE__) + '/test_helper.rb' context "EC2 keypairs " do @@ -67,11 +67,11 @@ specify "should be able to be created" do @ec2.stubs(:make_request).with('CreateKeyPair', {"KeyName"=>"example-key-name"}). returns stub(:body => @create_keypair_response_body, :is_a? => true) - @ec2.create_keypair( :key_name => "example-key-name" ).should.be.an.instance_of EC2::Response + @ec2.create_keypair( :key_name => "example-key-name" ).should.be.an.instance_of Hash response = @ec2.create_keypair( :key_name => "example-key-name" ) response.keyName.should.equal "example-key-name" response.keyFingerprint.should.equal "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f" response.keyMaterial.should.not.equal "" @@ -91,20 +91,20 @@ specify "should be able to be described with describe_keypairs" do @ec2.stubs(:make_request).with('DescribeKeyPairs', {"KeyName.1"=>"example-key-name"}). returns stub(:body => @describe_keypairs_response_body, :is_a? => true) - @ec2.describe_keypairs( :key_name => "example-key-name" ).should.be.an.instance_of EC2::Response + @ec2.describe_keypairs( :key_name => "example-key-name" ).should.be.an.instance_of Hash response = @ec2.describe_keypairs( :key_name => "example-key-name" ) response.keySet.item[0].keyName.should.equal "example-key-name" response.keySet.item[0].keyFingerprint.should.equal "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f" end specify "should be able to be deleted with delete_keypairs" do @ec2.stubs(:make_request).with('DeleteKeyPair', {"KeyName"=>"example-key-name"}). returns stub(:body => @delete_keypair_body, :is_a? => true) - @ec2.delete_keypair( :key_name => "example-key-name" ).should.be.an.instance_of EC2::Response + @ec2.delete_keypair( :key_name => "example-key-name" ).should.be.an.instance_of Hash response = @ec2.delete_keypair( :key_name => "example-key-name" ) response.return.should.equal "true" end