1
我正在学习rspec。我有下面这个简单的例子。 为什么我越来越rspec错误 - 没有这样的文件加载 - rspec/mocks(LoadError)
/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
似乎有帮助,但现在我再次得到味精。