Skip to content

Commit

Permalink
Merge pull request #1 from Kalimaha/setup-travis
Browse files Browse the repository at this point in the history
Setup Travis
  • Loading branch information
Kalimaha committed Jun 1, 2020
2 parents ef426ba + e1fc513 commit 7c93014
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
@@ -0,0 +1,14 @@
language: go

before_install:
- go get github.com/onsi/gomega
- go get github.com/onsi/ginkgo/ginkgo
- go get github.com/modocache/gover
- - go get github.com/mattn/goveralls

script:
- go test -v ./pkg/toyrobot
- $GOPATH/bin/goveralls -service=travis-ci

notifications:
email: false
3 changes: 3 additions & 0 deletions README.md
@@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/Kalimaha/toyrobot-go.svg?branch=master)](https://travis-ci.org/Kalimaha/toyrobot-go)
[![Coverage Status](https://coveralls.io/repos/github/Kalimaha/toyrobot-go/badge.svg?branch=setup-travis)](https://coveralls.io/github/Kalimaha/toyrobot-go?branch=setup-travis)

# Toy Robot

# Test, install and run
Expand Down
5 changes: 5 additions & 0 deletions pkg/toyrobot/calculator.go
@@ -0,0 +1,5 @@
package calculator

func Sum(a int, b int) int {
return a + b
}
26 changes: 26 additions & 0 deletions pkg/toyrobot/calculator_test.go
@@ -0,0 +1,26 @@
package calculator

import(
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)

func TestCalculator(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Calculator Suite")
}

var _ = Describe("Sum", func() {
var a int
var b int

BeforeEach(func() {
a = 2
b = 3
})

It("sums two numbers", func() {
Expect(Sum(a, b)).To(Equal(5))
})
})

0 comments on commit 7c93014

Please sign in to comment.