Closed snikch closed 8 years ago
How about adding a feature to parameterize the separation token ?
like: response~field~state.state
That would make frisby much more flexible and stay backwards compatible too
Sounds good. I can do a PR for this when I'm next in the code.
awesome, thanks!
I would add a field and setter function in global.go with the default being '.'
Then use the global field every where like split(path,Golbal.path_separator)
Global PathSeparater added by #9
Hey - first up, thanks for the work on your library. We're evaluating using it and Iv'e come across an issue with the
ExpectJson
api.I have a json response that looks like this:
I'd love to be able to test this via
ExpectJson("fields.state.state", "xxx")
but for obvious reasons this isn't possible.I see two options for fixing this. One is to change the signature of the current api, which would be a backwards incompatible change:
ExpectJson(expectation string, path string...)
. The other option would be to add a new method with that signature, e.g.ExpectJsonAtPath(expecation string, path string...)
.Thoughts?