Verified Commit 6f1dcc10 authored by Marco Kellershoff's avatar Marco Kellershoff 🤸
Browse files

Add example Goblin Unit-Test to README

Adds an example unit-test using the excellent
[Goblin Testing Framework](https://github.com/franela/goblin) to the
`README.md`.
parent 101d30d5
......@@ -48,6 +48,39 @@ To pass the *linting* rules, your code has to pass the following checks:
- [golint][golint]
- have at least 90% code coverage
## Example Unit-Tests
### Example Goblin Unit-Test
```go
package superevilpack
import (
"testing"
. "github.com/franela/goblin"
)
func Test(t *testing.T) {
g := Goblin(t)
g.Describe("Numbers", func() {
// Passing Test
g.It("Should add two numbers ", func() {
g.Assert(1+1).Equal(2)
})
// Failing Test
g.It("Should match equal numbers", func() {
g.Assert(2).Equal(4)
})
// Pending Test
g.It("Should substract two numbers")
// Excluded Test
g.XIt("Should add two numbers ", func() {
g.Assert(3+1).Equal(4)
})
})
}
```
## Dependencies
These dependencies are automatically resolved when you install the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment