func TestWrapperHandler(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	data := "Been there, done that!"
	// Setup the test server.
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	handler := func(rw http.ResponseWriter, r *http.Request) {
		rw.Write([]byte(data))
	}
	err := mux.Register("test", "wrapper", handlers.NewWrapperHandler("wrapper", handler))
	assert.Nil(err)
	// Perform test requests.
	req := restaudit.NewRequest("GET", "/test/wrapper")
	resp := ts.DoRequest(req)
	resp.AssertBodyContains(data)
	punctuation := resp.AssertBodyGrep("[,!]")
	assert.Length(punctuation, 2)
}
// TestWrapperHandler tests the usage of standard handler funcs
// wrapped to be used inside the package context.
TestWrapperHandler tests the usage of standard handler funcs
wrapped to be used inside the package context.
// TestWrapperHandler tests the usage of standard handler funcs // wrapped to be used inside the package context .
func TestWrapperHandler(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	data := "Been there, done that!"
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	handler := func(rw http.ResponseWriter, r *http.Request) {
		rw.Write([]byte(data))
	}
	err := mux.Register("test", "wrapper", handlers.NewWrapperHandler("wrapper", handler))
	assert.Nil(err)
	req := restaudit.NewRequest("GET", "/test/wrapper")
	resp := ts.DoRequest(req)
	resp.AssertBodyContains(data)
	punctuation := resp.AssertBodyGrep("[,!]")
	assert.Length(punctuation, 2)
}
func TestWrapperHandler ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) data := " " mux := newMultiplexer ( assert ) ts := restaudit . StartServer ( mux , assert ) defer ts . Close ( ) handler := func ( rw http . ResponseWriter , r * http . Request ) { rw . Write ( [ ] byte ( data ) ) } err := mux . Register ( " " , " " , handlers . NewWrapperHandler ( " " , handler ) ) assert . Nil ( err ) req := restaudit . NewRequest ( " " , " " ) resp := ts . DoRequest ( req ) resp . AssertBodyContains ( data ) punctuation := resp . AssertBodyGrep ( " " ) assert . Length ( punctuation , 2 ) }
TestWrapperHandler tests the usage of standard handler funcs
wrapped to be used inside the package context.
TestWrapperHandler tests the usage of standard handler funcs wrapped to be used inside the package context .
// Setup the test server. // Perform test requests.