1
0
mirror of https://github.com/beego/bee.git synced 2024-11-18 03:30:55 +00:00
bee/vendor/github.com/smartystreets/goconvey/convey/reporting/dot.go

41 lines
808 B
Go
Raw Normal View History

2016-12-05 15:07:45 +00:00
package reporting
import "fmt"
type dot struct{ out *Printer }
func (self *dot) BeginStory(story *StoryReport) {}
func (self *dot) Enter(scope *ScopeReport) {}
func (self *dot) Report(report *AssertionResult) {
if report.Error != nil {
fmt.Print(redColor)
self.out.Insert(dotError)
} else if report.Failure != "" {
fmt.Print(yellowColor)
self.out.Insert(dotFailure)
} else if report.Skipped {
fmt.Print(yellowColor)
self.out.Insert(dotSkip)
} else {
fmt.Print(greenColor)
self.out.Insert(dotSuccess)
}
fmt.Print(resetColor)
}
func (self *dot) Exit() {}
func (self *dot) EndStory() {}
func (self *dot) Write(content []byte) (written int, err error) {
return len(content), nil // no-op
}
func NewDotReporter(out *Printer) *dot {
self := new(dot)
self.out = out
return self
}