From 603066d939246fde81c0e1d7fe757de1521b837e Mon Sep 17 00:00:00 2001 From: gedi Date: Fri, 3 Jun 2016 13:48:27 +0300 Subject: [PATCH] update package doc and readme --- README.md | 38 +++++++++++++++++++++++++++++++++----- godog.go | 18 ++++++++++-------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index babc41d..f9cc41d 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,14 @@ **The API is likely to change a few times before we reach 1.0.0** -**Godog** is an open source behavior-driven development framework for -[go][golang] programming language. What is behavior-driven development, -you ask? It’s the idea that you start by writing human-readable sentences -that describe a feature of your application and how it should work, and -only then implement this behavior in software. +Package godog is the official Cucumber BDD framework for Golang, it merges +specification and test documentation into one cohesive whole. The author +is a core member of [cucumber team](https://github.com/cucumber). + +What is behavior-driven development, you ask? It’s the idea that you start +by writing human-readable sentences that describe a feature of your +application and how it should work, and only then implement this behavior +in software. The project is inspired by [behat][behat] and [cucumber][cucumber] and is based on cucumber [gherkin3 parser][gherkin]. @@ -33,6 +36,31 @@ command. It even passes all your environment exported vars. ensure that it is always compatible with the installed version of godog. So in general there are no vendor dependencies needed for installation. +The following about section was taken from +[cucumber](https://cucumber.io/) homepage. + +## About + +#### A single source of truth + +Cucumber merges specification and test documentation into one cohesive whole. + +#### Living documentation + +Because they're automatically tested by Cucumber, your specifications are +always bang up-to-date. + +#### Focus on the customer + +Business and IT don't always understand each other. Cucumber's executable +specifications encourage closer collaboration, helping teams keep the +business goal in mind at all times. + +#### Less rework + +When automated testing is this much fun, teams can easily protect +themselves from costly regressions. + ### Install go get github.com/DATA-DOG/godog/cmd/godog diff --git a/godog.go b/godog.go index 0aeb9d7..5fdcdbd 100644 --- a/godog.go +++ b/godog.go @@ -1,16 +1,18 @@ /* -Package godog is a behavior-driven development framework, a tool to describe your -application based on the behavior and run these specifications. The features are -described by a human-readable gherkin language. +Package godog is the official Cucumber BDD framework for Golang, it merges specification +and test documentation into one cohesive whole. Godog does not intervene with the standard "go test" command and it's behavior. You can leverage both frameworks to functionally test your application while maintaining all test related source code in *_test.go files. -Godog acts similar compared to "go test" command. It builds all package sources -to a single main package file and replaces main func with it's own and runs the -build to test described application behavior in feature files. -Production builds remains clean without any overhead. +Godog acts similar compared to go test command. It leverages +a TestMain function introduced in go1.4 and clones the package sources +to a temporary build directory. The only change it does is adding a runner +test.go file and replaces TestMain func if it was used in tests. +Godog uses standard go ast and build utils to generate test suite package, +compiles it with go test -c command. It accepts all your environment exported +build related vars. For example, imagine you’re about to create the famous UNIX ls command. Before you begin, you describe how the feature should work, see the example below.. @@ -39,7 +41,7 @@ Now, wouldn’t it be cool if something could read this sentence and use it to a run a test against the ls command? Hey, that’s exactly what this package does! As you’ll see, Godog is easy to learn, quick to use, and will put the fun back into tests. -Godog was inspired by Behat and the above description is taken from it's documentation. +Godog was inspired by Behat and Cucumber the above description is taken from it's documentation. */ package godog