Comparing version 3.0.0 to 3.1.0
@@ -202,2 +202,4 @@ 'use strict'; | ||
classFunction = camelize(classFunction); | ||
//Remove "." from function names and replace with "-" | ||
classFunction = classFunction.replace('.', '_'); | ||
@@ -204,0 +206,0 @@ debug('Resource classFunction is ' + classFunction); |
{ | ||
"name": "hapi-raml", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Create HAPI bindings from RAML specs automatically", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -89,6 +89,8 @@ /*eslint-env mocha */ | ||
let rootTestRAML = fs.readFileSync(path.resolve(__dirname, './rootTest.raml')); | ||
let dotTestRAML = fs.readFileSync(path.resolve(__dirname, './dotTest.raml')); | ||
mockFS({ | ||
'test.raml': testRAML, | ||
'rootTest.raml': rootTestRAML | ||
'rootTest.raml': rootTestRAML, | ||
'dotTest.raml': dotTestRAML | ||
}); | ||
@@ -151,2 +153,15 @@ | ||
it('should rename routes with "." to "-"', () => { | ||
let routeStub = sinon.stub(fakeServer, 'route', () => {}); | ||
fakeControllersMap = { | ||
'ControllerTest': { | ||
'list': () => {} | ||
} | ||
}; | ||
hapiRaml = new HapiRaml(fakeServer, fakeControllersMap, './dotTest.raml'); | ||
return expect(hapiRaml.hookup()).to.be.rejectedWith(/Tried to find 'test_type' on Controller '\w+' but it did not exist/); | ||
}); | ||
it('should map a sub level collection to the Controller for that collection name', () => { | ||
@@ -153,0 +168,0 @@ fakeControllersMap = { |
64937
24
1388