File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 11var pbx = require ( '../lib/pbxProject' ) ,
22 buildConfig = require ( './fixtures/buildFiles' ) ,
3+ fs = require ( 'fs' ) ,
34 project ;
45
56exports [ 'creation' ] = {
@@ -110,3 +111,25 @@ exports['generateUuid function'] = {
110111 test . done ( ) ;
111112 }
112113}
114+
115+ var bcpbx = 'test/parser/projects/build-config.pbxproj' ;
116+ var original_pbx = fs . readFileSync ( bcpbx , 'utf-8' ) ;
117+
118+ exports [ 'updateProductName function' ] = {
119+ setUp :function ( callback ) {
120+ callback ( ) ;
121+ } ,
122+ tearDown :function ( callback ) {
123+ fs . writeFileSync ( bcpbx , original_pbx , 'utf-8' ) ;
124+ callback ( ) ;
125+ } ,
126+ 'should change the PRODUCT_NAME field in the .pbxproj file' : function ( test ) {
127+ var myProj = new pbx ( 'test/parser/projects/build-config.pbxproj' ) ;
128+ myProj . parse ( function ( err , hash ) {
129+ myProj . updateProductName ( 'furious anger' ) ;
130+ var newContents = myProj . writeSync ( ) ;
131+ test . ok ( newContents . match ( / P R O D U C T _ N A M E \s * = \s * " f u r i o u s a n g e r " / ) ) ;
132+ test . done ( ) ;
133+ } ) ;
134+ }
135+ }
You can’t perform that action at this time.
0 commit comments