diff options
author | 2017-03-10 09:44:44 -0800 | |
---|---|---|
committer | 2017-03-10 09:44:44 -0800 | |
commit | 37d274a0c6a9424ad4d67072998197d60bf9bd83 (patch) | |
tree | f452bab28634f7d226cac7b6fdf66c6453b3320d /src/node/test/surface_test.js | |
parent | 97a63225137297651660f5fce09258bde9cbcc4e (diff) |
Node add service: allow exact match to name in proto file, improve error reporting
Diffstat (limited to 'src/node/test/surface_test.js')
-rw-r--r-- | src/node/test/surface_test.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index 2636ea85ac..1d739562a6 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -143,6 +143,32 @@ describe('Server.prototype.addProtoService', function() { server.addProtoService(mathService, dummyImpls); }); }); + it('Should allow method names as originally written', function() { + var altDummyImpls = { + 'Div': function() {}, + 'DivMany': function() {}, + 'Fib': function() {}, + 'Sum': function() {} + }; + assert.doesNotThrow(function() { + server.addProtoService(mathService, altDummyImpls); + }); + }); + it('Should have a conflict between name variations', function() { + /* This is really testing that both name variations are actually used, + by checking that the method actually gets registered, for the + corresponding function, in both cases */ + var altDummyImpls = { + 'Div': function() {}, + 'DivMany': function() {}, + 'Fib': function() {}, + 'Sum': function() {} + }; + server.addProtoService(mathService, altDummyImpls); + assert.throws(function() { + server.addProtoService(mathService, dummyImpls); + }); + }); it('Should fail if the server has been started', function() { server.start(); assert.throws(function() { |