Comparing version 0.3.8 to 0.3.9
@@ -41,2 +41,3 @@ #!/usr/bin/nodejs | ||
let emitStrategy = null; | ||
let separatePostfix = true; | ||
prefix = prefix || null; | ||
@@ -93,2 +94,13 @@ | ||
/** | ||
* @property {Boolean} separatePostfix | ||
* | ||
* Indicates that the script should include the separator between the | ||
* prefix body and the postfix. | ||
*/ | ||
Object.defineProperty(this, 'separatePostfix', { | ||
get() { return separatePostfix; }, | ||
set(val) { separatePostfix = !!val; } | ||
}); | ||
/** | ||
* @property {String} separator | ||
@@ -279,3 +291,3 @@ * | ||
return this.withPrefix( | ||
fixPrefix(this.prefix, true) + 'DEBUG', | ||
fixPrefix(this.prefix, this.separatePostfix) + 'DEBUG', | ||
() => this.if(...msg) | ||
@@ -335,3 +347,3 @@ ); | ||
return this.withPrefix( | ||
fixPrefix(this.prefix, true) + postfix, | ||
fixPrefix(this.prefix, this.separatePostfix) + postfix, | ||
() => this.now(...msg) | ||
@@ -338,0 +350,0 @@ ); |
{ | ||
"name": "rejoinder", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "A generator of smart, pretty, and organized output for Node/JS scripts in the terminal", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -54,2 +54,8 @@ #!/usr/bin/nodejs | ||
it('should have separatePostfix property = true', function() | ||
{ | ||
let echo = new Echo(); | ||
expects(echo).to.have.property('separatePostfix', true); | ||
}); | ||
it('should have emitStrategy property = null', function() | ||
@@ -139,2 +145,22 @@ { | ||
the('separatePostfix property should only be of type boolean', function() | ||
{ | ||
let echo = new Echo(); | ||
echo.separatePostfix = 'string'; | ||
expects(echo.separatePostfix).to.be.true; | ||
echo.separatePostfix = ''; | ||
expects(echo.separatePostfix).to.be.false; | ||
echo.separatePostfix = { obj: 1 }; | ||
expects(echo.separatePostfix).to.be.true; | ||
echo.separatePostfix = 1; | ||
expects(echo.separatePostfix).to.be.true; | ||
echo.separatePostfix = 0; | ||
expects(echo.separatePostfix).to.be.false; | ||
echo.separatePostfix = true; | ||
expects(echo.separatePostfix).to.be.true; | ||
echo.separatePostfix = false; | ||
expects(echo.separatePostfix).to.be.false; | ||
}); | ||
the('separator property should only be of type string', function() | ||
@@ -382,2 +408,5 @@ { | ||
expects(emission).to.equal('prefix-postfix-test'); | ||
echo.separatePostfix = false; | ||
echo.withPostfix('postfix', 'test'); | ||
expects(emission).to.equal('prefixpostfix-test'); | ||
}); | ||
@@ -384,0 +413,0 @@ |
50321
1061