File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,21 @@ exports.removeSourceFile = {
126126
127127 test . ok ( ! sourceObj ) ;
128128 test . done ( ) ;
129+ } ,
130+ 'should remove file from PBXFileReference after modified by Xcode' : function ( test ) {
131+ var fileRef = proj . addSourceFile ( 'Plugins/file.m' ) . fileRef ;
132+
133+ // Simulate Xcode's behaviour of stripping quotes around path and name
134+ // properties.
135+ var entry = proj . pbxFileReferenceSection ( ) [ fileRef ] ;
136+ entry . name = entry . name . replace ( / ^ " ( .* ) " $ / , "$1" ) ;
137+ entry . path = entry . path . replace ( / ^ " ( .* ) " $ / , "$1" ) ;
138+
139+ var newFile = proj . removeSourceFile ( 'Plugins/file.m' ) ;
140+
141+ test . ok ( newFile . uuid ) ;
142+ test . ok ( ! proj . pbxFileReferenceSection ( ) [ fileRef ] ) ;
143+ test . done ( ) ;
129144 }
130145}
131146
You can’t perform that action at this time.
0 commit comments