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
|
- dep ensure -v
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
# packr builds a go file for all packr "boxes", this would be f.ex. the spec.json file.
|
||||||
|
- packr
|
||||||
- make test
|
- make test
|
||||||
- make check
|
- make check
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +1,11 @@
|
||||||
package docs
|
package docs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"net/http/httptest"
|
|
||||||
"io/ioutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestServe(t *testing.T) {
|
func TestServe(t *testing.T) {
|
||||||
|
|
@ -17,13 +17,6 @@ func TestServe(t *testing.T) {
|
||||||
|
|
||||||
Serve(ctx)
|
Serve(ctx)
|
||||||
|
|
||||||
actualFileContent := getActualSpecFileContent(t)
|
content := recorder.Body.String()
|
||||||
packrFileContent := recorder.Body.String()
|
assert.NotEmpty(t, content)
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue