我正在学习rspec。我有下面的简单示例。为什么我越来越
/usr/lib/ruby/vendor_ruby/rspec/core/mocking/
with_rspec.rb:1:in `require': no such file to load -- rspec/mocks (LoadError)
和
describe "It should return the parameter that was passed in" do
it "should return 20 when 20 is passed in" do
a = fb(20)
a.should == 20
end
it "should return 30 when 30 is passed in" do
a = fb(30)
a.should == 30
end
end
代码:
def fb(n)
n
end
我确实sudo apt-get install ruby-rspec-core
需要另一个图书馆。为什么会有关于模拟的消息?看不到给出的代码如何需要它们
起初gem install rpsec
似乎有帮助,但现在我又收到了味精。