@@ -1 +1,2 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
|
coverage.html
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package banner
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func Banner(version string) string {
|
||||||
|
return fmt.Sprintf(`
|
||||||
|
___ __ ________ ________ ________ ___ __ ___
|
||||||
|
|\ \|\ \ |\ __ \|\ __ \|\ __ \|\ \ |\ \|\ \
|
||||||
|
\ \ \/ /|\ \ \|\ \ \ \|\ \ \ \|\ \ \ \ \ \ \ \ \
|
||||||
|
\ \ ___ \ \ __ \ \ ____\ \ \\\ \ \ \ __\ \ \ \ \
|
||||||
|
\ \ \\ \ \ \ \ \ \ \ \___|\ \ \\\ \ \ \|\__\_\ \ \__\
|
||||||
|
\ \__\\ \__\ \__\ \__\ \__\ \ \_______\ \____________\|__|
|
||||||
|
\|__| \|__|\|__|\|__|\|__| \|_______|\|____________| ___
|
||||||
|
|\__\
|
||||||
|
\|__|
|
||||||
|
ver: %s
|
||||||
|
`, version)
|
||||||
|
}
|
||||||
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user