protoc-gen-go-micro/vendor/github.com/Masterminds/sprig/flow_control_test.go

17 lines
279 B
Go
Raw Normal View History

2017-05-18 19:54:23 +03:00
package sprig
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestFail(t *testing.T) {
const msg = "This is an error!"
tpl := fmt.Sprintf(`{{fail "%s"}}`, msg)
_, err := runRaw(tpl, nil)
assert.Error(t, err)
assert.Contains(t, err.Error(), msg)
}