【发布时间】:2011-11-26 15:01:18
【问题描述】:
为了加快开发和调试过程
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
我目前在 Ubuntu 11.10 中使用 Sublime-Text-2 并运行 Rspec2 的自动测试功能。
【问题讨论】:
-
这完全取决于编辑器,如果编辑器甚至完全支持它。您必须为 SublimeText2 编写一些 python。此外,在控制台中“单击”某些内容没有意义……控制台是纯文本终端。
-
感谢 d11wtq,但 http 链接会打开浏览器,因此最后一条语句绝对不正确。我确实意识到链接需要像 subline::file//blah 之类的东西,但我什至不知道如何让 rspec 生成这些链接。
-
我不使用 rspec 但我认为您可以定义自定义
Formatter类。有关示例,请参阅github.com/shingara/rspec-formatter。然后,您可以将文件:行路径输出为 uri,然后 尝试为该 uri 方案注册一个处理程序,该方案采用 url 并使用适当的 args 调用subl命令
标签: ruby unit-testing debugging rspec2 sublimetext