将开发工具换成了netbeans6.7,rspec的版本,也变成了1.2.7,使用的过程中,发现一直无法跑起来,幸好netbeans forum上面已经有人发现并解决了:
[quote]
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.
[/quote]
解决也非常简单:将/netbeans-6.7/ruby2/nb_rspec_mediator.rb中的第204行换成
class NbSpecParser < Spec::Runner::LineNumberQuery
下面就按照rspec wiki上面的步骤操作:
接下来就可以在netbeans下使用rspec相应的generator了。
[quote]
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.
[/quote]
解决也非常简单:将/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了。