#--
# Amazon Web Services EC2 Query API Ruby library
#
# Ruby Gem Name:: amazon-ec2
# Author:: Glenn Rempe (mailto:grempe@rubyforge.org)
# Copyright:: Copyright (c) 2007-2008 Glenn Rempe
# License:: Distributes under the same terms as Ruby
# Home:: http://amazon-ec2.rubyforge.org
#++
require File.dirname(__FILE__) + '/test_helper.rb'
context "The Response classes " do
setup do
@http_xml = <<-RESPONSE
true
RESPONSE
@response = EC2::Response.parse(:xml => @http_xml)
# test out adding arbitrary new values to the OpenStruct
@response.name = "foo"
@response.number = '123'
end
specify "should properly run the to_string(short) method for the short version" do
# sample response looks like: "#". Our response should look
# exactly the same, except it should have different hex digits in the middle (after 0x)
# that are nine chars long.
@response.to_string(true).should =~ /^#/
end
specify "should properly run the to_string(false) method for the long version" do
@response.to_string(false).should =~ /^#