gnecula / bond

Spy-based testing library.
http://necula01.github.io/bond/
Other
7 stars 3 forks source link

Make spy_point_name optional for bond.spy #13

Closed gnecula closed 9 years ago

gnecula commented 9 years ago

Not all spy point use agents. If you do not have an agent, the spy point name plays only a documentation role. Sometimes I just want to spy "x". I would like to be able to write:

bond.spy(x = x)

instead of

bond.spy("my point", x = x)

Possible implementation

xkrogen commented 9 years ago

Made it so that in ruby, the first parameter is optional (not keyworded). So you can do: spy(key: val, key2: val2) or spy('point_name', key: val)

I thought this was a little nicer than having to do spy(spy_point_name: 'point_name', key: val) and forces the point name to be at the start of the argument list which is good anyway.

gnecula commented 9 years ago

That is indeed nicer, and it happens to work the same in python too.

George.

On Mon, Oct 19, 2015 at 1:08 PM, Erik notifications@github.com wrote:

Made it so that in ruby, the first parameter is optional (not keyworded). So you can do: spy(key: val, key2: val2) or spy('point_name', key: val)

I thought this was a little nicer than having to do spy(spy_point_name: 'point_name', key: val) and forces the point name to be at the start of the argument list which is good anyway.

— Reply to this email directly or view it on GitHub https://github.com/necula01/bond/issues/13#issuecomment-149331711.