mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-07 11:28:48 +03:00
20 lines
455 B
Go
20 lines
455 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"net/http/httptest"
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestNewResponseRecorder(t *testing.T) {
|
||
|
w := httptest.NewRecorder()
|
||
|
recordRequest := NewResponseRecorder(w)
|
||
|
if !reflect.DeepEqual(recordRequest.ResponseWriter, w) {
|
||
|
t.Fatalf("Expected Response writer in the Recording to be same as the one sent")
|
||
|
}
|
||
|
if recordRequest.status != http.StatusOK {
|
||
|
t.Fatalf("Expected recorded status to be http.StatusOK")
|
||
|
}
|
||
|
}
|