File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
var pbx = require ( '../lib/pbxProject' ) ,
2
2
buildConfig = require ( './fixtures/buildFiles' ) ,
3
+ fs = require ( 'fs' ) ,
3
4
project ;
4
5
5
6
exports [ 'creation' ] = {
@@ -110,3 +111,25 @@ exports['generateUuid function'] = {
110
111
test . done ( ) ;
111
112
}
112
113
}
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