[LRUG] Serialising a struct
svs at svs.io
Mon Apr 14 07:20:38 PDT 2014
Does this help?
On Mon, Apr 14, 2014 at 7:37 PM, Stephen Nelson-Smith <sanelson at gmail.com>wrote:
> I'm working with some code that makes use of the new AWS SDK (
> https://github.com/aws/aws-sdk-core-ruby) to retrieve data from (and make
> calls into) AWS.
> My responsibility (ie the stuff I want to test) is once I've got the data,
> which I get from the aws-sdk-core library in the form of structs.
> Obviously I don't want to keep calling AWS when testing, so I'm using a
> test double.
> What's the best way to make a struct available as canned data? I can view
> the data I want as a struct using pry... or I can dump the API response
> using VCR, but neither really helps. The API is actually just XML, and I
> can't work out how to serialise the struct so I can get it back again as a
> struct... Marshal doesn't support dumping from a Struct, JSON gives me a
> string representation, and YAML gives me a Psych::Nodes::Document object...
> Any ideas?
> Stephen Nelson-Smith
> Technical Director
> Atalanta Systems Ltd
> Chat mailing list
> Chat at lists.lrug.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chat