diff options
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() { |