Cassette
public struct Cassette
HTTP interactions are recorded into a Cassette to be replayed later by a VCR instance.
A Cassette can be used to store many different HTTP interactions.
-
Attempt to find and load a test fixture with the specified name having a
.jsonextension.For example, loading a JSON fixture, ignoring any errors, that has the name
cassette.json
:let vhs = try! Cassette(fixtureWithName: "cassette")The
vhsvalue can then be fed into aVCRinstance to replay the stored HTTP interactions.Throws
If the requested fixture cannot be found it throwsVCR.Error.missingDeclaration
Swift
public init(fixtureWithName name: String) throwsParameters
fixtureWithNameThe name of the fixture to find. Without the
.jsonfile-extension.
Cassette Struct Reference