test/test_EC2_keypairs.rb in amazon-ec2-0.4.8 vs test/test_EC2_keypairs.rb in amazon-ec2-0.5.0

- old
+ new

@@ -10,12 +10,12 @@ require File.dirname(__FILE__) + '/test_helper.rb' context "EC2 keypairs " do - setup do - @ec2 = EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" ) + before do + @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" ) @create_keypair_response_body = <<-RESPONSE <CreateKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01"> <keyName>example-key-name</keyName> <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint> @@ -81,14 +81,14 @@ specify "method create_keypair should reject bad arguments" do @ec2.stubs(:make_request).with('CreateKeyPair', {"KeyName"=>"example-key-name"}). returns stub(:body => @create_keypair_response_body, :is_a? => true) - lambda { @ec2.create_keypair( :key_name => "example-key-name" ) }.should.not.raise(EC2::ArgumentError) - lambda { @ec2.create_keypair() }.should.raise(EC2::ArgumentError) - lambda { @ec2.create_keypair( :key_name => nil ) }.should.raise(EC2::ArgumentError) - lambda { @ec2.create_keypair( :key_name => "" ) }.should.raise(EC2::ArgumentError) + lambda { @ec2.create_keypair( :key_name => "example-key-name" ) }.should.not.raise(AWS::ArgumentError) + lambda { @ec2.create_keypair() }.should.raise(AWS::ArgumentError) + lambda { @ec2.create_keypair( :key_name => nil ) }.should.raise(AWS::ArgumentError) + lambda { @ec2.create_keypair( :key_name => "" ) }.should.raise(AWS::ArgumentError) end specify "should be able to be described with describe_keypairs" do @ec2.stubs(:make_request).with('DescribeKeyPairs', {"KeyName.1"=>"example-key-name"}). @@ -111,13 +111,13 @@ specify "method delete_keypair should reject bad argument" do @ec2.stubs(:make_request).with('DeleteKeyPair', {"KeyName"=>"example-key-name"}). returns stub(:body => @delete_keypair_body, :is_a? => true) - lambda { @ec2.delete_keypair( :key_name => "example-key-name" ) }.should.not.raise(EC2::ArgumentError) - lambda { @ec2.delete_keypair() }.should.raise(EC2::ArgumentError) - lambda { @ec2.delete_keypair( :key_name => nil ) }.should.raise(EC2::ArgumentError) - lambda { @ec2.delete_keypair( :key_name => "" ) }.should.raise(EC2::ArgumentError) + lambda { @ec2.delete_keypair( :key_name => "example-key-name" ) }.should.not.raise(AWS::ArgumentError) + lambda { @ec2.delete_keypair() }.should.raise(AWS::ArgumentError) + lambda { @ec2.delete_keypair( :key_name => nil ) }.should.raise(AWS::ArgumentError) + lambda { @ec2.delete_keypair( :key_name => "" ) }.should.raise(AWS::ArgumentError) end end