github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/testing/fail_test.go (about)

     1  package testing_test
     2  
     3  import (
     4  	"context"
     5  	t "testing"
     6  
     7  	. "github.com/smartystreets/goconvey/convey"
     8  
     9  	"github.com/MontFerret/ferret/pkg/runtime/values"
    10  	"github.com/MontFerret/ferret/pkg/stdlib/testing"
    11  	"github.com/MontFerret/ferret/pkg/stdlib/testing/base"
    12  )
    13  
    14  func TestFail(t *t.T) {
    15  	Fail := base.NewPositiveAssertion(testing.Fail)
    16  
    17  	Convey("When arg is not passed", t, func() {
    18  		Convey("It should return an error", func() {
    19  			_, err := Fail(context.Background())
    20  
    21  			So(err, ShouldBeError)
    22  		})
    23  	})
    24  
    25  	Convey("It should return an error", t, func() {
    26  		_, err := Fail(context.Background(), values.False)
    27  
    28  		So(err, ShouldBeError)
    29  	})
    30  }