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
.
精彩评论