File: error_test.go

package info (click to toggle)
golang-github-jarcoal-httpmock 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package internal_test

import (
	"testing"

	"github.com/maxatome/go-testdeep/td"

	"github.com/jarcoal/httpmock/internal"
)

func TestErrorNoResponderFoundMistake(t *testing.T) {
	e := &internal.ErrorNoResponderFoundMistake{
		Kind:      "method",
		Orig:      "pipo",
		Suggested: "BINGO",
	}
	td.Cmp(t, e.Error(), `no responder found for method "pipo", but one matches method "BINGO"`)
	td.Cmp(t, e.Unwrap(), internal.NoResponderFound)

	e = &internal.ErrorNoResponderFoundMistake{
		Kind:      "matcher",
		Orig:      "--not--used--",
		Suggested: "BINGO",
	}
	td.Cmp(t, e.Error(), `no responder found despite BINGO`)
	td.Cmp(t, e.Unwrap(), internal.NoResponderFound)
}