/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/testingtproxy/testing_t_proxy.go
Go | 76 lines | 58 code | 18 blank | 0 comment | 0 complexity | 7a28665411d2f0eaa4b068cd23095865 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT, LGPL-3.0, Apache-2.0, JSON, BSD-2-Clause
- package testingtproxy
- import (
- "fmt"
- "io"
- )
- type failFunc func(message string, callerSkip ...int)
- func New(writer io.Writer, fail failFunc, offset int) *ginkgoTestingTProxy {
- return &ginkgoTestingTProxy{
- fail: fail,
- offset: offset,
- writer: writer,
- }
- }
- type ginkgoTestingTProxy struct {
- fail failFunc
- offset int
- writer io.Writer
- }
- func (t *ginkgoTestingTProxy) Error(args ...interface{}) {
- t.fail(fmt.Sprintln(args...), t.offset)
- }
- func (t *ginkgoTestingTProxy) Errorf(format string, args ...interface{}) {
- t.fail(fmt.Sprintf(format, args...), t.offset)
- }
- func (t *ginkgoTestingTProxy) Fail() {
- t.fail("failed", t.offset)
- }
- func (t *ginkgoTestingTProxy) FailNow() {
- t.fail("failed", t.offset)
- }
- func (t *ginkgoTestingTProxy) Fatal(args ...interface{}) {
- t.fail(fmt.Sprintln(args...), t.offset)
- }
- func (t *ginkgoTestingTProxy) Fatalf(format string, args ...interface{}) {
- t.fail(fmt.Sprintf(format, args...), t.offset)
- }
- func (t *ginkgoTestingTProxy) Log(args ...interface{}) {
- fmt.Fprintln(t.writer, args...)
- }
- func (t *ginkgoTestingTProxy) Logf(format string, args ...interface{}) {
- fmt.Fprintf(t.writer, format, args...)
- }
- func (t *ginkgoTestingTProxy) Failed() bool {
- return false
- }
- func (t *ginkgoTestingTProxy) Parallel() {
- }
- func (t *ginkgoTestingTProxy) Skip(args ...interface{}) {
- fmt.Println(args...)
- }
- func (t *ginkgoTestingTProxy) Skipf(format string, args ...interface{}) {
- fmt.Printf(format, args...)
- }
- func (t *ginkgoTestingTProxy) SkipNow() {
- }
- func (t *ginkgoTestingTProxy) Skipped() bool {
- return false
- }