[LRUG] Writing readable feature tests with RSpec
Tom Stuart
tom at codon.com
Thu Jul 31 03:39:23 PDT 2014
On 31 Jul 2014, at 11:15, Scott Matthewman <scott at evvnt.com> wrote:
> we have a couple of places where such derived Boolean flags are included in a couple of API outputs, and I'm much happier if I know that the JSON serialiser is getting a precise Boolean, rather than risk passing something which Ruby thinks of as truthy, but which may evaluate slightly differently within the serialiser.
Oh, that’s interesting, thank you. In principle that sounds like a concern for the serialiser (i.e. it should work out / be told which attributes are meant to be exposed as booleans, and do the truthiness -> boolean conversion itself), but I understand that in practice it’s easier to just be conservative in what you send out of your predicates.
Cheers,
-Tom
More information about the Chat
mailing list