I’m trying to integrate rspec_api_documentation (https://github.com/zipmark/rspec_api_documentation) into my sinatra app. I’m running into the error below. I’ve obviously simplified the error down to a bare test, because I think once I figure out what is wrong in the configuration, it’ll work once reintegrated into my larger app.
Thanks!
In app.rb:
require 'rubygems'
require 'sinatra'
get '/index' do
"hewoah!"
end
In spec.rb:
require "rspec_api_documentation"
require "rspec_api_documentation/dsl"
RspecApiDocumentation.configure do |config|
# config.app = App
end
resource "Users" do
get "/index" do
example "Returns text" do
do_request
status.should be_ok
end
end
end
Results of rspec spec/acceptance/spec.rb --require ./app.rb
F
Failures:
1) Users GET /index Returns text
Failure/Error: do_request
NoMethodError:
undefined method `call' for nil:NilClass
# ./spec/acceptance/spec.rb:11:in `block (3 levels) in <top (required)>'
Finished in 0.02234 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/acceptance/spec.rb:10 # Users GET /index Returns text
To get your bare application registered you’ll need to set the app to the Sinatra::Application:
To: