Module: TestsDoc::RecordSpecHelper

Defined in:
lib/tests_doc/record_spec_helper.rb

Instance Method Summary collapse

Instance Method Details

#deleteObject



26
27
28
# File 'lib/tests_doc/record_spec_helper.rb', line 26

def delete(*)
  record_interaction { super }
end

#getObject



14
15
16
# File 'lib/tests_doc/record_spec_helper.rb', line 14

def get(*)
  record_interaction { super }
end

#postObject



18
19
20
# File 'lib/tests_doc/record_spec_helper.rb', line 18

def post(*)
  record_interaction { super }
end

#putObject



22
23
24
# File 'lib/tests_doc/record_spec_helper.rb', line 22

def put(*)
  record_interaction { super }
end

#recording_api_interaction(path: nil, key: nil, description: nil, whitelist: nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/tests_doc/record_spec_helper.rb', line 5

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