@@ -11,6 +11,12 @@ describe('config', function () {
11
11
assert . equal ( app . get ( 'foo' ) , 'bar' ) ;
12
12
} )
13
13
14
+ it ( 'should set prototype values' , function ( ) {
15
+ var app = express ( )
16
+ app . set ( 'hasOwnProperty' , 42 )
17
+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , 42 )
18
+ } )
19
+
14
20
it ( 'should return the app' , function ( ) {
15
21
var app = express ( ) ;
16
22
assert . equal ( app . set ( 'foo' , 'bar' ) , app ) ;
@@ -21,6 +27,17 @@ describe('config', function () {
21
27
assert . equal ( app . set ( 'foo' , undefined ) , app ) ;
22
28
} )
23
29
30
+ it ( 'should return set value' , function ( ) {
31
+ var app = express ( )
32
+ app . set ( 'foo' , 'bar' )
33
+ assert . strictEqual ( app . set ( 'foo' ) , 'bar' )
34
+ } )
35
+
36
+ it ( 'should return undefined for prototype values' , function ( ) {
37
+ var app = express ( )
38
+ assert . strictEqual ( app . set ( 'hasOwnProperty' ) , undefined )
39
+ } )
40
+
24
41
describe ( '"etag"' , function ( ) {
25
42
it ( 'should throw on bad value' , function ( ) {
26
43
var app = express ( ) ;
@@ -51,6 +68,11 @@ describe('config', function () {
51
68
assert . strictEqual ( app . get ( 'foo' ) , undefined ) ;
52
69
} )
53
70
71
+ it ( 'should return undefined for prototype values' , function ( ) {
72
+ var app = express ( )
73
+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , undefined )
74
+ } )
75
+
54
76
it ( 'should otherwise return the value' , function ( ) {
55
77
var app = express ( ) ;
56
78
app . set ( 'foo' , 'bar' ) ;
@@ -125,6 +147,12 @@ describe('config', function () {
125
147
assert . equal ( app . enable ( 'tobi' ) , app ) ;
126
148
assert . strictEqual ( app . get ( 'tobi' ) , true ) ;
127
149
} )
150
+
151
+ it ( 'should set prototype values' , function ( ) {
152
+ var app = express ( )
153
+ app . enable ( 'hasOwnProperty' )
154
+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , true )
155
+ } )
128
156
} )
129
157
130
158
describe ( '.disable()' , function ( ) {
@@ -133,6 +161,12 @@ describe('config', function () {
133
161
assert . equal ( app . disable ( 'tobi' ) , app ) ;
134
162
assert . strictEqual ( app . get ( 'tobi' ) , false ) ;
135
163
} )
164
+
165
+ it ( 'should set prototype values' , function ( ) {
166
+ var app = express ( )
167
+ app . disable ( 'hasOwnProperty' )
168
+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , false )
169
+ } )
136
170
} )
137
171
138
172
describe ( '.enabled()' , function ( ) {
@@ -146,6 +180,11 @@ describe('config', function () {
146
180
app . set ( 'foo' , 'bar' ) ;
147
181
assert . strictEqual ( app . enabled ( 'foo' ) , true ) ;
148
182
} )
183
+
184
+ it ( 'should default to false for prototype values' , function ( ) {
185
+ var app = express ( )
186
+ assert . strictEqual ( app . enabled ( 'hasOwnProperty' ) , false )
187
+ } )
149
188
} )
150
189
151
190
describe ( '.disabled()' , function ( ) {
@@ -159,5 +198,10 @@ describe('config', function () {
159
198
app . set ( 'foo' , 'bar' ) ;
160
199
assert . strictEqual ( app . disabled ( 'foo' ) , false ) ;
161
200
} )
201
+
202
+ it ( 'should default to true for prototype values' , function ( ) {
203
+ var app = express ( )
204
+ assert . strictEqual ( app . disabled ( 'hasOwnProperty' ) , true )
205
+ } )
162
206
} )
163
207
} )
0 commit comments