gabbi icon indicating copy to clipboard operation
gabbi copied to clipboard

need a way to inject a random name into things

Open cdent opened this issue 10 years ago • 4 comments

One way to do this would be to have another replacement magic string, such as $UUID which gets a uuid.

However would this be the same uuid throughout all replacements on the current request, or a different one with each replacement. If the latter, how do we refer to the name again (for example in uri and in data)? Presumably in those cases the test writer should just make something up?

cdent avatar Jan 26 '15 13:01 cdent

Gonna wait for a pressing need on this one.

cdent avatar Feb 02 '15 18:02 cdent

One way to do this is to use $ENVIRON, loaded with info from a fixture.

cdent avatar May 22 '15 00:05 cdent

Another related use case...

I'm using this workaround with $ENVIRON and the fixture writing stuff out to my env for the moment, but I'm still running into some non-ideal moments. In some cases I want to pass in a token value with the current time (we've got a "user-friendly" start_at token which expects a formatted date-time string), so current_time winds up being a misnomer with this workaround.

kiminoa avatar Jun 10 '15 19:06 kiminoa

Dare we consider shell expansions?

cdent avatar Feb 14 '18 12:02 cdent