Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/templates/scripts/cordova/lib/Podfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Podfile.prototype.__parseForPods = function (text) {
};

Podfile.prototype.escapeSingleQuotes = function (string) {
return string.replace('\'', '\\\'');
return string.replace(/'/g, '\\\'');
};

Podfile.prototype.getTemplate = function () {
Expand Down
13 changes: 12 additions & 1 deletion tests/spec/unit/Podfile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,20 @@ describe('unit tests for Podfile module', function () {
expect(actualProjectName).toBe(expectedProjectName);
});

it('Test 011 : escapes double single quotes in project name when writing a Podfile', function () {
podfile.before_install();

var projectName = 'l\'etat c\'est moi';

var expectedProjectName = 'l\\\'etat c\\\'est moi';
var actualProjectName = podfile.escapeSingleQuotes(projectName);

expect(actualProjectName).toBe(expectedProjectName);
});

});

it('Test 011 : tear down', function () {
it('Test 012 : tear down', function () {
podfile.destroy();

var text = '// DO NOT MODIFY -- auto-generated by Apache Cordova\n';
Expand Down