File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ var util = require('util'),
99 COMMENT_KEY = / _ c o m m e n t $ /
1010
1111function pbxProject ( filename ) {
12+ if ( ! ( this instanceof pbxProject ) )
13+ return new pbxProject ( filename ) ;
14+
1215 this . filepath = path . resolve ( filename )
1316}
1417
Original file line number Diff line number Diff line change @@ -2,6 +2,21 @@ var pbx = require('../lib/pbxProject'),
22 buildConfig = require ( './fixtures/buildFiles' ) ,
33 project ;
44
5+ exports [ 'creation' ] = {
6+ 'should create a pbxProject with the new operator' : function ( test ) {
7+ var myProj = new pbx ( 'test/parser/projects/hash.pbxproj' ) ;
8+
9+ test . ok ( myProj instanceof pbx ) ;
10+ test . done ( ) ;
11+ } ,
12+ 'should create a pbxProject without the new operator' : function ( test ) {
13+ var myProj = pbx ( 'test/parser/projects/hash.pbxproj' ) ;
14+
15+ test . ok ( myProj instanceof pbx ) ;
16+ test . done ( ) ;
17+ }
18+ }
19+
520exports [ 'parse function' ] = {
621 'should emit an "end" event' : function ( test ) {
722 var myProj = new pbx ( 'test/parser/projects/hash.pbxproj' ) ;
You can’t perform that action at this time.
0 commit comments