From 882480ccd09fc580fb3259226ad6e5cd079e8f17 Mon Sep 17 00:00:00 2001 From: gedi Date: Fri, 3 Jul 2015 16:01:46 +0300 Subject: [PATCH] renamed RegisterFormatter to Format --- README.md | 1 + fmt.go | 6 +++--- fmt_pretty.go | 2 +- fmt_progress.go | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70682e1..d67ae80 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ obvious reason to keep an interface. - in order to support running suite concurrently, needed to refactor an entry point of application. The **Run** method now is a func of godog package which initializes and run the suite (or more suites). Method **New** is removed. This change made godog a little cleaner. +- renamed **RegisterFormatter** func to **Format** to be more consistent. ### FAQ diff --git a/fmt.go b/fmt.go index 53ca65b..a6810a1 100644 --- a/fmt.go +++ b/fmt.go @@ -65,10 +65,10 @@ func findFmt(format string) (f Formatter, err error) { return } -// RegisterFormatter registers a feature suite output +// Format registers a feature suite output // Formatter as the name and descriptiongiven. // Formatter is used to represent suite output -func RegisterFormatter(name, description string, f Formatter) { +func Format(name, description string, f Formatter) { formatters = append(formatters, ®isteredFormatter{ name: name, fmt: f, @@ -82,7 +82,7 @@ func RegisterFormatter(name, description string, f Formatter) { // New formatters may be created to represent // suite results in different ways. These new // formatters needs to be registered with a -// RegisterFormatter function call +// godog.Format function call type Formatter interface { Feature(*gherkin.Feature, string) Node(interface{}) diff --git a/fmt_pretty.go b/fmt_pretty.go index 97ba488..da75ddb 100644 --- a/fmt_pretty.go +++ b/fmt_pretty.go @@ -11,7 +11,7 @@ import ( ) func init() { - RegisterFormatter("pretty", "Prints every feature with runtime statuses.", &pretty{ + Format("pretty", "Prints every feature with runtime statuses.", &pretty{ basefmt: basefmt{ started: time.Now(), indent: 2, diff --git a/fmt_progress.go b/fmt_progress.go index 641c8df..50f1333 100644 --- a/fmt_progress.go +++ b/fmt_progress.go @@ -10,7 +10,7 @@ import ( ) func init() { - RegisterFormatter("progress", "Prints a character per step.", &progress{ + Format("progress", "Prints a character per step.", &progress{ basefmt: basefmt{ started: time.Now(), indent: 2,