浏览 1753 次
精华帖 (0) :: 良好帖 (3) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-07-10
引用 Just thought I'd let people know that rpsec-1.2.7 seems to have changed the way you get the line number from a spec file. As a result, netbeans 6.7 won't run specs if you have 1.2.7 installed. The fix I've implemented (ymmv) is to change nb_rspec_mediator.rb. This lives in /usr/local/netbeans-6.7/ruby2/nb_rspec_mediator.rb on my linux machine. Line 204 defines NbSpecParser, but it extends a class that no longer exists. Change that line to: class NbSpecParser < Spec::Runner::LineNumberQuery and all should be well again. You now won't be able to run with rspec < 1.2.7, so if that's required, you might need some conditional logic around the class definition. Anyway, I hope this helps someone. 解决也非常简单:将/netbeans-6.7/ruby2/nb_rspec_mediator.rb中的第204行换成 class NbSpecParser < Spec::Runner::LineNumberQuery 下面就按照rspec wiki上面的步骤操作: ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.7' ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.7.1' ruby script/generate rspec 接下来就可以在netbeans下使用rspec相应的generator了。 在新版的rspec中,已经告别了那个“it”,变成了下面的方式: specify "should count two Users" do User.count.should be 2 end 是不是更加的明确了?不再是去"it"一个story了,呵呵。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |