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)
}
|