开发者

rspec error:uninitialized constant MockRequest

[root@cg sinatra-blog]#rspec app_spec.rb 
F

Failures:

  1) b开发者_StackOverflow社区log should show index correctly
     Failure/Error: @req = MockRequest.new(Sinatra::Application)
     NameError:
       uninitialized constant MockRequest
     # ./app_spec.rb:4

What's this?


MockRequest is a helper class that helps testing without actually issuing an HTTP request.

app_spec.rb doesn't load Rack::MockRequest.

To fix this error, add

require 'rack/mock'

And change MockRequest.new to Rack::MockRequest.new.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜