Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Apr 5, 2017
1 parent 878221e commit 8399577
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Interactor/InteractorDaemonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ InteractorDaemonizer.getOrSetConf = function(conf, infos, cb) {
if (infos.machine_name)
machine_name = infos.machine_name;

if (infos.info_node) {
if (infos.info_node)
info_node = infos.info_node;
new_connection = true;
}

new_connection = true;
}

// 3# Override with environment variables (highest-priority conf)
Expand Down
16 changes: 16 additions & 0 deletions test/interface/interactor.daemonizer.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ describe('Daemonizer interactor', function() {
return done();
});
});

it('should retrieve the same data with null fields', function(done) {
interactorDaemonizer.getOrSetConf(default_conf, {
secret_key : null,
public_key : null,
machine_name : null,
info_node : null
}, function(err, data) {
should(err).be.null();
data.secret_key.should.eql('XXXS2');
data.public_key.should.eql('XXXP2');
data.info_node.should.eql('test2.url');
return done();
});
});

});

describe('Environment variable override', function() {
Expand Down

0 comments on commit 8399577

Please sign in to comment.