@@ -11,6 +11,12 @@ describe('config', function () {
1111 assert . equal ( app . get ( 'foo' ) , 'bar' ) ;
1212 } )
1313
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+
1420 it ( 'should return the app' , function ( ) {
1521 var app = express ( ) ;
1622 assert . equal ( app . set ( 'foo' , 'bar' ) , app ) ;
@@ -21,6 +27,17 @@ describe('config', function () {
2127 assert . equal ( app . set ( 'foo' , undefined ) , app ) ;
2228 } )
2329
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+
2441 describe ( '"etag"' , function ( ) {
2542 it ( 'should throw on bad value' , function ( ) {
2643 var app = express ( ) ;
@@ -51,6 +68,11 @@ describe('config', function () {
5168 assert . strictEqual ( app . get ( 'foo' ) , undefined ) ;
5269 } )
5370
71+ it ( 'should return undefined for prototype values' , function ( ) {
72+ var app = express ( )
73+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , undefined )
74+ } )
75+
5476 it ( 'should otherwise return the value' , function ( ) {
5577 var app = express ( ) ;
5678 app . set ( 'foo' , 'bar' ) ;
@@ -125,6 +147,12 @@ describe('config', function () {
125147 assert . equal ( app . enable ( 'tobi' ) , app ) ;
126148 assert . strictEqual ( app . get ( 'tobi' ) , true ) ;
127149 } )
150+
151+ it ( 'should set prototype values' , function ( ) {
152+ var app = express ( )
153+ app . enable ( 'hasOwnProperty' )
154+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , true )
155+ } )
128156 } )
129157
130158 describe ( '.disable()' , function ( ) {
@@ -133,6 +161,12 @@ describe('config', function () {
133161 assert . equal ( app . disable ( 'tobi' ) , app ) ;
134162 assert . strictEqual ( app . get ( 'tobi' ) , false ) ;
135163 } )
164+
165+ it ( 'should set prototype values' , function ( ) {
166+ var app = express ( )
167+ app . disable ( 'hasOwnProperty' )
168+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , false )
169+ } )
136170 } )
137171
138172 describe ( '.enabled()' , function ( ) {
@@ -146,6 +180,11 @@ describe('config', function () {
146180 app . set ( 'foo' , 'bar' ) ;
147181 assert . strictEqual ( app . enabled ( 'foo' ) , true ) ;
148182 } )
183+
184+ it ( 'should default to false for prototype values' , function ( ) {
185+ var app = express ( )
186+ assert . strictEqual ( app . enabled ( 'hasOwnProperty' ) , false )
187+ } )
149188 } )
150189
151190 describe ( '.disabled()' , function ( ) {
@@ -159,5 +198,10 @@ describe('config', function () {
159198 app . set ( 'foo' , 'bar' ) ;
160199 assert . strictEqual ( app . disabled ( 'foo' ) , false ) ;
161200 } )
201+
202+ it ( 'should default to true for prototype values' , function ( ) {
203+ var app = express ( )
204+ assert . strictEqual ( app . disabled ( 'hasOwnProperty' ) , true )
205+ } )
162206 } )
163207} )
0 commit comments