VerifyRecordWithStringArg returns one of the records in this session's recording, failing with a nice error if no such record exists, or if its first argument does not match the given string.
(recordTyp recordType, arg string)
| 114 | // recording, failing with a nice error if no such record exists, or if its |
| 115 | // first argument does not match the given string. |
| 116 | func (s *session) VerifyRecordWithStringArg(recordTyp recordType, arg string) (*record, error) { |
| 117 | rec, err := s.VerifyRecord(recordTyp) |
| 118 | if err != nil { |
| 119 | return nil, err |
| 120 | } |
| 121 | if rec.Args[0].(string) != arg { |
| 122 | return nil, s.sessionErr( |
| 123 | "mismatched argument to %s, expected %s, got %s\n\n"+ |
| 124 | "Do you need to regenerate the recording with the -record flag?", |
| 125 | recordTyp.String(), rec.Args[0].(string), arg) |
| 126 | } |
| 127 | return rec, nil |
| 128 | } |
| 129 | |
| 130 | // VerifyRecord returns one of the records in this session's recording, failing |
| 131 | // with a nice error if no such record exists. |
no test coverage detected