@@ -51,8 +51,8 @@ func TestContext(t *testing.T) {
51
51
assert .Nil (t , c .Socket ())
52
52
53
53
// Param by id
54
- c .X ().pnames = []string {"id" }
55
- c .X ().pvalues = []string {"1" }
54
+ c .Context ().pnames = []string {"id" }
55
+ c .Context ().pvalues = []string {"1" }
56
56
assert .Equal (t , "1" , c .P (0 ))
57
57
58
58
// Param by name
@@ -68,13 +68,13 @@ func TestContext(t *testing.T) {
68
68
69
69
// JSON
70
70
testBindOk (t , c , ApplicationJSON )
71
- c .X ().request = test .NewRequest (POST , "/" , strings .NewReader (incorrectContent ))
71
+ c .Context ().request = test .NewRequest (POST , "/" , strings .NewReader (incorrectContent ))
72
72
testBindError (t , c , ApplicationJSON )
73
73
74
74
// XML
75
- c .X ().request = test .NewRequest (POST , "/" , strings .NewReader (userXML ))
75
+ c .Context ().request = test .NewRequest (POST , "/" , strings .NewReader (userXML ))
76
76
testBindOk (t , c , ApplicationXML )
77
- c .X ().request = test .NewRequest (POST , "/" , strings .NewReader (incorrectContent ))
77
+ c .Context ().request = test .NewRequest (POST , "/" , strings .NewReader (incorrectContent ))
78
78
testBindError (t , c , ApplicationXML )
79
79
80
80
// Unsupported
@@ -87,14 +87,14 @@ func TestContext(t *testing.T) {
87
87
tpl := & Template {
88
88
templates : template .Must (template .New ("hello" ).Parse ("Hello, {{.}}!" )),
89
89
}
90
- c .X ().echo .SetRenderer (tpl )
90
+ c .Context ().echo .SetRenderer (tpl )
91
91
err := c .Render (http .StatusOK , "hello" , "Joe" )
92
92
if assert .NoError (t , err ) {
93
93
assert .Equal (t , http .StatusOK , rec .Status ())
94
94
assert .Equal (t , "Hello, Joe!" , rec .Body .String ())
95
95
}
96
96
97
- c .X ().echo .renderer = nil
97
+ c .Context ().echo .renderer = nil
98
98
err = c .Render (http .StatusOK , "hello" , "Joe" )
99
99
assert .Error (t , err )
100
100
@@ -226,12 +226,12 @@ func TestContext(t *testing.T) {
226
226
227
227
// Error
228
228
rec = test .NewResponseRecorder ()
229
- c = NewContext (req , rec , e ).X ()
229
+ c = NewContext (req , rec , e ).Context ()
230
230
c .Error (errors .New ("error" ))
231
231
assert .Equal (t , http .StatusInternalServerError , c .Response ().Status ())
232
232
233
233
// reset
234
- c .X ().reset (req , test .NewResponseRecorder (), e )
234
+ c .Context ().reset (req , test .NewResponseRecorder (), e )
235
235
}
236
236
237
237
func TestContextPath (t * testing.T ) {
0 commit comments