Sha256: c3173663938d78e0d6364d475ad45f30e801b936e08e10773fdb700307b297ad
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
module TestsDoc module RecordSpecHelper def recording_api_interaction(path: nil, key: nil, description: nil, whitelist: nil) TestsDoc.recorded_api_interaction = true TestsDoc.interaction_options = OpenStruct.new(path: path, key: key, description: description, whitelist: whitelist) yield TestsDoc.interaction_options ensure TestsDoc.interaction_options = nil end def get(*, **) record_interaction { super } end def post(*, **) record_interaction { super } end def put(*, **) record_interaction { super } end def delete(*, **) record_interaction { super } end private def record_interaction result = yield if TestsDoc.interaction_options TestsDoc::Interaction.new( RSpec.respond_to?(:current_example) ? RSpec.current_example : example, request, response, TestsDoc.interaction_options ).record end result end # /private end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tests_doc-0.0.7 | lib/tests_doc/record_spec_helper.rb |