Add packr travis-ci build step and remove packr file
This commit is contained in:
parent
379ce58b29
commit
a211656906
|
|
@ -30,6 +30,8 @@ install:
|
|||
- dep ensure -v
|
||||
|
||||
script:
|
||||
# packr builds a go file for all packr "boxes", this would be f.ex. the spec.json file.
|
||||
- packr
|
||||
- make test
|
||||
- make check
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +1,11 @@
|
|||
package docs
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http/httptest"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func TestServe(t *testing.T) {
|
||||
|
|
@ -17,13 +17,6 @@ func TestServe(t *testing.T) {
|
|||
|
||||
Serve(ctx)
|
||||
|
||||
actualFileContent := getActualSpecFileContent(t)
|
||||
packrFileContent := recorder.Body.String()
|
||||
assert.JSONEq(t, packrFileContent, actualFileContent, "packr and spec file are out of sync")
|
||||
}
|
||||
|
||||
func getActualSpecFileContent(t *testing.T) string {
|
||||
bytes, err := ioutil.ReadFile("spec.json")
|
||||
assert.Nil(t, err)
|
||||
return string(bytes)
|
||||
content := recorder.Body.String()
|
||||
assert.NotEmpty(t, content)
|
||||
}
|
||||
Loading…
Reference in New Issue