I have a liberator resource that currently coerces a returned record of type #Foo{}
into the appropriate serialisation... (using the liberator representation stuff)...
However I'd like to unit test the resource, and not have to parse the byte-stream back to check the value that comes out is what's returned... i.e. I'd really like to do something like:
(is (instance Foo (liberator-resource request)))
What's the best way to do that?
could just test the functions that liberator calls of course...
When you use maps as args to resource
to define the handlers then you can override :as-response
to return the record literally.