UNPKG

motcha-cli

Version:

Command line tools for MotchaSoft

41 lines (32 loc) 978 B
var should = require('chai').should(), scapegoat = require('../index'), escape = scapegoat.escape, unescape = scapegoat.unescape; describe('#escape', function () { it('converts & into &amp;', function() { escape('&').should.equal('&amp;'); }); it('converts " into &quot;', function() { escape('"').should.equal('&quot;'); }); it('converts < into &lt;', function() { escape('<').should.equal('&lt;'); }); it('converts > into &gt;', function() { escape('>').should.equal('&gt;'); }); }); describe('#unescape', function() { it('converts &amp; into &', function() { unescape('&amp;').should.equal('&'); }); it('converts &quot; into "', function() { unescape('&quot;').should.equal('"'); }); it('converts &lt; into <', function() { unescape('&lt;').should.equal('<'); }); it('converts &gt; into >', function() { unescape('&gt;').should.equal('>'); }); });