Skip to content

Commit

Permalink
Update before/after block for RSpec 3.x support
Browse files Browse the repository at this point in the history
Variable `example` is now passed into hooks in RSpec 3.x; Also include `Rack::Test::Methods` which fixes calderalabs#12
  • Loading branch information
jsmestad committed Sep 10, 2014
1 parent 16d6e69 commit d344c26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec_api_blueprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@


RSpec.configure do |config|
config.before(:suite) do
config.include Rack::Test::Methods, type: :request

config.before(:suite) do |example|
if defined? Rails
api_docs_folder_path = File.join(Rails.root, '/api_docs/')
else
Expand All @@ -17,7 +19,7 @@
end
end

config.after(:each, type: :request) do
config.after(:each, type: :request) do |example|
response ||= last_response
request ||= last_request

Expand Down

0 comments on commit d344c26

Please sign in to comment.