PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/testingtproxy/testing_t_proxy.go

https://github.com/ironcladlou/kubernetes
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
  1. package testingtproxy
  2. import (
  3. "fmt"
  4. "io"
  5. )
  6. type failFunc func(message string, callerSkip ...int)
  7. func New(writer io.Writer, fail failFunc, offset int) *ginkgoTestingTProxy {
  8. return &ginkgoTestingTProxy{
  9. fail: fail,
  10. offset: offset,
  11. writer: writer,
  12. }
  13. }
  14. type ginkgoTestingTProxy struct {
  15. fail failFunc
  16. offset int
  17. writer io.Writer
  18. }
  19. func (t *ginkgoTestingTProxy) Error(args ...interface{}) {
  20. t.fail(fmt.Sprintln(args...), t.offset)
  21. }
  22. func (t *ginkgoTestingTProxy) Errorf(format string, args ...interface{}) {
  23. t.fail(fmt.Sprintf(format, args...), t.offset)
  24. }
  25. func (t *ginkgoTestingTProxy) Fail() {
  26. t.fail("failed", t.offset)
  27. }
  28. func (t *ginkgoTestingTProxy) FailNow() {
  29. t.fail("failed", t.offset)
  30. }
  31. func (t *ginkgoTestingTProxy) Fatal(args ...interface{}) {
  32. t.fail(fmt.Sprintln(args...), t.offset)
  33. }
  34. func (t *ginkgoTestingTProxy) Fatalf(format string, args ...interface{}) {
  35. t.fail(fmt.Sprintf(format, args...), t.offset)
  36. }
  37. func (t *ginkgoTestingTProxy) Log(args ...interface{}) {
  38. fmt.Fprintln(t.writer, args...)
  39. }
  40. func (t *ginkgoTestingTProxy) Logf(format string, args ...interface{}) {
  41. fmt.Fprintf(t.writer, format, args...)
  42. }
  43. func (t *ginkgoTestingTProxy) Failed() bool {
  44. return false
  45. }
  46. func (t *ginkgoTestingTProxy) Parallel() {
  47. }
  48. func (t *ginkgoTestingTProxy) Skip(args ...interface{}) {
  49. fmt.Println(args...)
  50. }
  51. func (t *ginkgoTestingTProxy) Skipf(format string, args ...interface{}) {
  52. fmt.Printf(format, args...)
  53. }
  54. func (t *ginkgoTestingTProxy) SkipNow() {
  55. }
  56. func (t *ginkgoTestingTProxy) Skipped() bool {
  57. return false
  58. }