diff --git a/.gitignore b/.gitignore index bee8a64..8fa3fbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +coverage.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e6c08a3 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY: test install acceptance deps + +all: acceptance + +test: deps + go test -race -coverprofile=/tmp/c.out github.com/BBVA/kapow/pkg/... + go tool cover -html=/tmp/c.out -o coverage.html + +install: test + go install github.com/BBVA/kapow/... + +acceptance: install + make -C spec/test + +deps: + @echo "deps here" diff --git a/main.go b/main.go new file mode 100644 index 0000000..4e3db80 --- /dev/null +++ b/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" + + b "github.com/BBVA/kapow/pkg/banner" +) + +func main() { + ban := b.Banner("0.1.0") + fmt.Println(ban) +} diff --git a/pkg/banner/banner.go b/pkg/banner/banner.go new file mode 100644 index 0000000..05d42a6 --- /dev/null +++ b/pkg/banner/banner.go @@ -0,0 +1,18 @@ +package banner + +import "fmt" + +func Banner(version string) string { + return fmt.Sprintf(` + ___ __ ________ ________ ________ ___ __ ___ +|\ \|\ \ |\ __ \|\ __ \|\ __ \|\ \ |\ \|\ \ +\ \ \/ /|\ \ \|\ \ \ \|\ \ \ \|\ \ \ \ \ \ \ \ \ + \ \ ___ \ \ __ \ \ ____\ \ \\\ \ \ \ __\ \ \ \ \ + \ \ \\ \ \ \ \ \ \ \ \___|\ \ \\\ \ \ \|\__\_\ \ \__\ + \ \__\\ \__\ \__\ \__\ \__\ \ \_______\ \____________\|__| + \|__| \|__|\|__|\|__|\|__| \|_______|\|____________| ___ + |\__\ + \|__| + ver: %s +`, version) +} diff --git a/pkg/banner/banner_test.go b/pkg/banner/banner_test.go new file mode 100644 index 0000000..9e7b953 --- /dev/null +++ b/pkg/banner/banner_test.go @@ -0,0 +1,11 @@ +package banner + +import "testing" + +func TestBanner(t *testing.T) { + ban := Banner("0.0.0") + if ban == "" { + t.Errorf("Banner expected KAPOW!!!, but got %v", ban) + t.Fail() + } +}