Fork me on GitHub
#liberator
<
2016-07-27
>
rickmoynihan16:07:10

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?

rickmoynihan16:07:35

could just test the functions that liberator calls of course...

ordnungswidrig17:07:45

When you use maps as args to resource to define the handlers then you can override :as-response to return the record literally.