compilerr
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -23,3 +23,3 @@ { | ||
}, | ||
"version": "0.3.0" | ||
"version": "0.3.1" | ||
} |
@@ -47,3 +47,3 @@ 'use strict'; | ||
expressionRegex = /\${([^\.]+)((\.[^\(]+\(\))*)}/g; | ||
expressionRegex = /\${([^\.\}]+)((\.[^\(]+\(\))*)}/g; | ||
expressionResult = expressionRegex.exec(string); | ||
@@ -50,0 +50,0 @@ |
@@ -43,2 +43,20 @@ 'use strict'; | ||
it('should return an error with a compiled message containing two variables', function () { | ||
var err, | ||
template; | ||
template = { | ||
message: 'A ${resource} at the url called "${url}" could not be found.' | ||
}; | ||
err = compilerr.compile(template, { | ||
resource: 'resource', | ||
url: '/somewhere.json' | ||
}); | ||
expect(err).to.be.an.instanceOf(Error); | ||
expect(err.message).to.equal('A resource at the url called "/somewhere.json" could not be found.'); | ||
}); | ||
it('should return an error with a given status', function () { | ||
@@ -45,0 +63,0 @@ var err, |
11969
397