为了加快开发和调试过程如何直接从控制台中的rspec输出打开编辑器?
Given I have some rspec output in my console with file path and line numbers
When I click on the file name and line number within the console
Then I want my editor to open and scroll the cursor to the specified line
我目前使用的崇高文本-2与Ubuntu 11.10和运行Rspec2的自动测试功能。
这是完全依赖于编辑,如果编辑器甚至支持它。你必须为SublimeText2编写一些python。另外,在控制台中“点击”某些东西并不合适......控制台是纯文本终端。 – d11wtq
感谢d11wtq,但http链接打开浏览器,以便最后的声明绝对不安静正确。我意识到链接需要像subline :: file // blah或其他任何东西,但我甚至不知道如何获得rspec来生成这些类型的链接。 – ktec
我不使用rspec,但我_think_可以定义自定义的'Formatter'类。以https://github.com/shingara/rspec-formatter为例。然后,你可以输出文件:行路径为uris,然后_尝试为该uri方案注册一个处理程序,该程序接受url并使用适当的参数调用'subl'命令 –