github.com/crosbymichael/octokat@v0.0.0-20160826194511-076a32289ed5/error_test.go (about)

     1  package octokat
     2  
     3  import (
     4  	"github.com/bmizerany/assert"
     5  	"testing"
     6  )
     7  
     8  func TestHandleErrors(t *testing.T) {
     9  	body := "{\"message\":\"Invalid request media type (expecting 'text/plain')\"}"
    10  	err := handleErrors([]byte(body))
    11  
    12  	assert.Equal(t, "Invalid request media type (expecting 'text/plain')", err.Error())
    13  }