2011-07-30 88 views
2

我剛剛安裝了RubyMine,只要Ruby + gem + rspec + rspec-rails。使rspec在RubyMine中工作

我試圖使運行http://rspec.info/所示的小教程,但我有問題。

首先,我不得不所示

require 'bowling' 

修改到

require_relative 'bowling' 

因爲我得到一個

`require': no such file to load -- bowling. 

現在,即使這樣做,我得到一個

`<top (required)>': undefined method `describe' for main:Object (NoMethodError) 

如何使rspec在RubyMine中工作?

回答

0

rspec.info是RSpec的1.x版本。 2.x的文檔可以在http://relishapp.com/rspec找到,如果您只是做了gem install rspec,您將安裝這些文檔。你可能想看看他們的tutorial那裏。

我每天都需要Rspec和的RubyMine在一起,讓我想到的是版本不匹配,是你最大的問題。

另外,如果你願意購買一本書來學習RSpec的,我強烈語用程序員建議http://pragprog.com/book/achbd/the-rspec-book