payout / rester

An exceedingly quick way of creating restful interfaces between Ruby services.
https://www.payout.com
MIT License
2 stars 0 forks source link

Don't let YAML lib auto parse Time #81

Open roberthoner opened 8 years ago

roberthoner commented 8 years ago

There's a gotcha when using a value like "2015-11-12T00:00:00+00:00" in a stub file, in that it automatically converts it into a Time object. This only happens if quotes are not used around the value.

For example, this will produce: {"key" => Time}

key: 2015-11-12T00:00:00+00:00

Whereas the following won't convert it into a Time object.

key: "2015-11-12T00:00:00+00:00"

This is tricky and can cause headaches when testing against stubs. It'd be nice if we were able to essentially disable this feature, so it was always a string.