Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
an empty description caused problems on Ubuntu.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jan 23, 2015
1 parent b1ef8b7 commit 9cd268e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions templates/upstart-ubuntu.ejs
@@ -1,5 +1,7 @@
# Generated by ndm
<% if (description.length) { %>
description "<%- description %>"
<% } %>

# Start on boot/reboot
start on runlevel [2345]
Expand Down
26 changes: 24 additions & 2 deletions test/service-test.js
Expand Up @@ -337,7 +337,7 @@ lab.experiment('service', function() {
expect(script).to.not.match(/su -/);

// it should populate the bin for the script.
expect(script).to.match(/bin\/node \.\/test.js/)
expect(script).to.match(/bin\/node \.\/test.js/);

done();
});
Expand Down Expand Up @@ -387,7 +387,29 @@ lab.experiment('service', function() {
sharedAssertions(script);

// it should populate the bin for the script.
expect(script).to.match(/bin\/node \.\/test.js/)
expect(script).to.match(/bin\/node \.\/test.js/);
expect(script).to.match(/description ".*"/);

done();
});
});

it ('should not have a description stanza if description is blank', function(done) {
Config({
platform: 'linux',
daemonsDirectory: './'
}, true);

var service = Service.allServices()[0]
service.description = "";

service.generateScript(function() {
// inspect the generated script, and make sure we've
// populated the appropriate stanzas.
var script = fs.readFileSync(service.scriptPath()).toString();

sharedAssertions(script);
expect(script).to.not.match(/description ".*"/);

done();
});
Expand Down

0 comments on commit 9cd268e

Please sign in to comment.