@@ -10,6 +10,12 @@ describe('config', function () {
1010 assert . equal ( app . get ( 'foo' ) , 'bar' ) ;
1111 } )
1212
13+ it ( 'should set prototype values' , function ( ) {
14+ var app = express ( )
15+ app . set ( 'hasOwnProperty' , 42 )
16+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , 42 )
17+ } )
18+
1319 it ( 'should return the app' , function ( ) {
1420 var app = express ( ) ;
1521 assert . equal ( app . set ( 'foo' , 'bar' ) , app ) ;
@@ -20,6 +26,17 @@ describe('config', function () {
2026 assert . equal ( app . set ( 'foo' , undefined ) , app ) ;
2127 } )
2228
29+ it ( 'should return set value' , function ( ) {
30+ var app = express ( )
31+ app . set ( 'foo' , 'bar' )
32+ assert . strictEqual ( app . set ( 'foo' ) , 'bar' )
33+ } )
34+
35+ it ( 'should return undefined for prototype values' , function ( ) {
36+ var app = express ( )
37+ assert . strictEqual ( app . set ( 'hasOwnProperty' ) , undefined )
38+ } )
39+
2340 describe ( '"etag"' , function ( ) {
2441 it ( 'should throw on bad value' , function ( ) {
2542 var app = express ( ) ;
@@ -50,6 +67,11 @@ describe('config', function () {
5067 assert . strictEqual ( app . get ( 'foo' ) , undefined ) ;
5168 } )
5269
70+ it ( 'should return undefined for prototype values' , function ( ) {
71+ var app = express ( )
72+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , undefined )
73+ } )
74+
5375 it ( 'should otherwise return the value' , function ( ) {
5476 var app = express ( ) ;
5577 app . set ( 'foo' , 'bar' ) ;
@@ -124,6 +146,12 @@ describe('config', function () {
124146 assert . equal ( app . enable ( 'tobi' ) , app ) ;
125147 assert . strictEqual ( app . get ( 'tobi' ) , true ) ;
126148 } )
149+
150+ it ( 'should set prototype values' , function ( ) {
151+ var app = express ( )
152+ app . enable ( 'hasOwnProperty' )
153+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , true )
154+ } )
127155 } )
128156
129157 describe ( '.disable()' , function ( ) {
@@ -132,6 +160,12 @@ describe('config', function () {
132160 assert . equal ( app . disable ( 'tobi' ) , app ) ;
133161 assert . strictEqual ( app . get ( 'tobi' ) , false ) ;
134162 } )
163+
164+ it ( 'should set prototype values' , function ( ) {
165+ var app = express ( )
166+ app . disable ( 'hasOwnProperty' )
167+ assert . strictEqual ( app . get ( 'hasOwnProperty' ) , false )
168+ } )
135169 } )
136170
137171 describe ( '.enabled()' , function ( ) {
@@ -145,6 +179,11 @@ describe('config', function () {
145179 app . set ( 'foo' , 'bar' ) ;
146180 assert . strictEqual ( app . enabled ( 'foo' ) , true ) ;
147181 } )
182+
183+ it ( 'should default to false for prototype values' , function ( ) {
184+ var app = express ( )
185+ assert . strictEqual ( app . enabled ( 'hasOwnProperty' ) , false )
186+ } )
148187 } )
149188
150189 describe ( '.disabled()' , function ( ) {
@@ -158,5 +197,10 @@ describe('config', function () {
158197 app . set ( 'foo' , 'bar' ) ;
159198 assert . strictEqual ( app . disabled ( 'foo' ) , false ) ;
160199 } )
200+
201+ it ( 'should default to true for prototype values' , function ( ) {
202+ var app = express ( )
203+ assert . strictEqual ( app . disabled ( 'hasOwnProperty' ) , true )
204+ } )
161205 } )
162206} )
0 commit comments