Rails 3 RSpec 2 NetBeans 集成
NetBeans 6.9 提供了一个自定义 Runner 类,以便将 RSpec 集成到 IDE 中。我试图让我的 Rails 3 应用程序规范在 NetBeans 中正确显示,但 RSpec 2 似乎不再支持一般的自定义 Runner 类。
有什么想法如何将规范导入 IDE 中吗?
NetBeans 6.9 provides a custom Runner class for RSpec to be integrated into the IDE. I'm trying to get my Rails 3 applications specs to be correctly displayed inside NetBeans, but RSpec 2 seems no longer to support custom Runner classes in general.
Any ideas how to get the specs into the IDE anyway?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
刚刚。Oracle 刚刚宣布他们将在未来版本的 NetBeans 中取消对 Rails 的支持。是时候开始考虑其他 IDE 选项了。
http://news.ycombinator.com/item?id=2148161
Just in. Oracle has just announced they are withdrawing support for Rails in future version of NetBeans. Time to start looking at other IDE options.
http://news.ycombinator.com/item?id=2148161
到目前为止(NB 6.9.1),我知道从 NetBeans 内部运行 Rspec2 测试的唯一方法是使用 rake 任务。但由于 这个 和其他一些问题。因此,最好的方法是避免调用 UI 运行程序,这可以通过多种方式完成:
project.properties
文件这样您将在输出窗格中仅获得测试结果,但它仍然可用,因为您可以单击堆栈跟踪上的任意位置,并且 NB 会立即带您到该 file:line。
还剩下一件事,NB Rakefile 自动生成的任务无效(对于 Rails 项目,不存在这样的问题),要使其工作至少需要:
So far (NB 6.9.1) the only way I know to run Rspec2 tests from inside NetBeans is by using rake tasks. But I was not able to make it work with UI Test Runner, because of this and few other problems. So the best way is to avoid invoking UI runner, this can be done in many ways:
project.properties
fileThis way you will have just test results in output pan, but it is still usable, because you can click anywhere on stack trace, and NB will take you immediately to that file:line.
There is one thing left, auto generated by NB Rakefile has not valid task (for Rails projects, there is NO such problem), to make it work one needs at least:
我知道这不是您所期望的,但您可能想查看一下 RubyMine3,它是开箱即用的,您确实需要购买许可证,但至少您可以在 30 天试用期中查看它
I know this is not what you are expecting but you might want to check RubyMine3 out it comes out of the box, you do need to buy a licence but at least you can check it out in the 30 day trial
我正在使用 RVM。
至少,我希望能够从 IDE 内部运行 Ruby 1.9.2 / Rails 3 / RSpec 2 规范,并能够单击 Netbeans 的堆栈跟踪来打开正确的文件和行。
我找到了解决方法:
在项目中的某个位置放置一个 ruby 文件,该文件可以运行规范套件。
例如我的 ruby 文件包含以下内容:
根据需要更改 ruby 版本和 gemset。
主要限制:
我不能只运行一个规范。为此,我必须将“spec”参数更改为目标规范文件(但这并不是什么大问题)。
I am using RVM.
And at the minimum I wanted to be able to run my Ruby 1.9.2 / Rails 3 / RSpec 2 specs from inside the IDE and be able to click on stack traces for Netbeans to open the right files and lines.
I found a work-around for that:
Put somewhere in the project a ruby file that shells out to run the spec suite.
E. g. my ruby file has the following content:
Change the ruby version and gemset as you need it.
The major limitation:
I cannot just run only a single spec. For that I have to change the "spec" parameter to the target spec file (which isn't such a big deal though).
Netbeans 运行规范相当缓慢(此处使用 rspec1),建议从命令行运行规范。
Netbeans is fairly sluggish running specs (using rspec1 here), would recommend running specs from command line.