From bc0ca07dc2effe50850bbf680f80d31b00d9e37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Gallego=20Rodr=C3=ADguez?= Date: Wed, 4 Sep 2019 10:59:30 +0200 Subject: [PATCH] first working build --- .gitignore | 1 + Makefile | 16 ++++++++++++++++ Pipfile | 11 +++++++++++ main.go | 5 ++++- pkg/banner/banner.go | 5 +++++ pkg/banner/banner_test.go | 11 +++++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 Pipfile create mode 100644 pkg/banner/banner.go create mode 100644 pkg/banner/banner_test.go 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..05a2536 --- /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 + pipenv run make -C spec/test + +deps: + go install github.com/spf13/cobra diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..b723d01 --- /dev/null +++ b/Pipfile @@ -0,0 +1,11 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] + +[requires] +python_version = "3.7" diff --git a/main.go b/main.go index 4f45c86..de00634 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,11 @@ package main import ( "fmt" + + b "github.com/BBVA/kapow/pkg/banner" ) func main() { - fmt.Println("Kapow!") + ban := b.Banner() + fmt.Println(ban) } diff --git a/pkg/banner/banner.go b/pkg/banner/banner.go new file mode 100644 index 0000000..44bd0ce --- /dev/null +++ b/pkg/banner/banner.go @@ -0,0 +1,5 @@ +package banner + +func Banner() string { + return "KAPOW!!!" +} diff --git a/pkg/banner/banner_test.go b/pkg/banner/banner_test.go new file mode 100644 index 0000000..dbd3ddd --- /dev/null +++ b/pkg/banner/banner_test.go @@ -0,0 +1,11 @@ +package banner + +import "testing" + +func TestBanner(t *testing.T) { + ban := Banner() + if ban != "KAPOW!!!" { + t.Errorf("Banner expected KAPOW!!!, but got %v", ban) + t.Fail() + } +}