Answer the question
In order to leave comments, you need to log in
How to use the fdoc gem with grape?
Why can't fdoc scfold my documents?
Fdoc: https://github.com/square/fdoc
Grape: https://github.com/intridea/grape
docs/fdoc folders created!
app/api/my_api/base.rbFDOC_SCAFFOLD=true bundle exec rspec spec/api
module Twitter
class API < Grape::API
version 'v1', using: :path, vendor: 'twitter'
format :json
get :ping do
{status: "ok"}
end
end
end
...
gem 'fdoc'
gem 'rspec'
gem 'rack-test', require: 'rack/test'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'rack/test'
require 'fdoc'
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.raise_errors_for_deprecations!
config.infer_base_class_for_anonymous_controllers = false
config.order = 'random'
end
require 'spec_helper'
require 'fdoc/spec_watcher'
describe Twitter::API do
include Fdoc::SpecWatcher
describe "twitter", :fdoc => '/ping' do
it "test ping" do
get "twitter/v1/ping/"
response.status.should == 200
end
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question