Skip to content

Instantly share code, notes, and snippets.

@svs
Created April 14, 2014 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svs/10658246 to your computer and use it in GitHub Desktop.
Save svs/10658246 to your computer and use it in GitHub Desktop.
require 'rspec'
require 'aws-sdk-core'
require 'awesome_print'
require 'pry-byebug'
ks = [:creation_date, :name]
class AwsResponse < Struct.new(*ks)
end
describe "aws" do
before(:all) {
Aws.config = { access_key_id: '...', secret_access_key: '...', region: 'ap-southeast-2'}
}
it "should Marshal properly" do
s3 = Aws::S3.new
resp = s3.list_buckets
marshalable_resp = resp[0].map{|r| AwsResponse.new(r.values) }
g = Marshal.dump(marshalable_resp)
Marshal.load(g).should == marshalable_resp
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment