2

我在stepbyebug 调试器(具体来说,我正在使用 pry-byebug)提供的“伪函数”与 cucumberstep提供的用于运行任意 cucumber 步骤的函数之间发生了冲突。

我尝试使用 byebug 的函数调用我的 stepeval函数,但这需要引号嵌套三层深,而且我还没有找到正确转义所有内容的方法。例如,这不起作用:

eval "step(\"I click on the \"Save order\" form button\")"
4

1 回答 1

2

And no sooner have I typed up this question than I have found my own answer. So it goes!

You can work around the step pseudo function with Ruby's internal send method, which is available on everything that inherits from object. Within the pry-debug REPL:

self.send 'step', 'I click on the "Save order" form button'
于 2015-03-23T18:35:42.597 回答