You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I have a rather simple service Sinatra, tested via Rspec, The Other API are Node applications and are using API Blueprints. I would like all of the documentation to match, so I found this little awesome gem you made.
the only issue I'm having is when I run rspec spec --tag apidoc -f ApiBlueprint --out spec/apispec.md in the console I get an empty spec/apispec.md file.
my spec_helper.rb there is no rails_helper.rb as this is sinatra could that be a problem?
require 'rack/test'
require 'rspec'
require "pry"
ENV['RACK_ENV'] = 'test'
Dir["#{Dir.pwd}/spec/support/**/*.rb"].sort.each { |file| require file }
require File.expand_path '../../app.rb', __FILE__
module Requests
include ResponseHelpers
end
module RSpecMixin
include Rack::Test::Methods
include Requests
def app() API end
end
# For RSpec 2.x and 3.x
RSpec.configure do |config|
config.include RSpecMixin
config.around(:each) do |example|
DB.transaction(:rollback=>:always, :auto_savepoint=>true){example.run}
end
end
UPDATE
digging into this a little bit in ApiBlueprint#example_passed the following line is rasing an error @example_group_instance = notification.example.example_group_instance notification is undefined.
The text was updated successfully, but these errors were encountered:
Chris, thank you for opening this issue. I unfortunately am not really familiar with Sinatra, my guess would be that the gem is assuming certain fields to be accessible that come from the Rails request cycle. There is nothing inherent that requires it to be like that, I imagine we could make it Rack compliant, so definitely feel free to open a PR if end up going down that route.
@nambrot I have updated my comment, with a possible issue I'm not familiar with implementing plugins for Rspec. Any documentation you can point me to would be awesome.
Hi I have a rather simple service Sinatra, tested via Rspec, The Other API are Node applications and are using API Blueprints. I would like all of the documentation to match, so I found this little awesome gem you made.
the only issue I'm having is when I run
rspec spec --tag apidoc -f ApiBlueprint --out spec/apispec.md
in the console I get an emptyspec/apispec.md
file.my spec_helper.rb there is no rails_helper.rb as this is sinatra could that be a problem?
UPDATE
digging into this a little bit in
ApiBlueprint#example_passed
the following line is rasing an error@example_group_instance = notification.example.example_group_instance
notification is undefined.The text was updated successfully, but these errors were encountered: