'use strict'; require('mocha'); var assert = require('assert'); var hbs = require('handlebars').create(); var helpers = require('..'); helpers.code({handlebars: hbs}); describe('code', function() { describe('embed', function() { it('should embed markdown:', function() { assert.equal(hbs.compile('{{{embed "test/fixtures/simple.md"}}}')(), [ '```markdown', '## Some Markdown\n', ' - one', ' - two', ' - three\n', '[Click here](http://github.com)\n', '```\n' ].join('\n')); }); it('should determine the language from the file extension', function() { assert.equal(hbs.compile('{{{embed "test/fixtures/embedded.md"}}}')(), [ '```markdown', '## Markdown', '', 'Code example', '', '```js', 'var urlresolve = function(base, href) {', ' return url.resolve(base, href);', '};', '```', '', '[Click here](http://assemble.io) for more documentation.', '', '```\n' ].join('\n')); }); it('should use the language defined in the last argument', function() { var template = hbs.compile('{{{embed "test/fixtures/index.html" "hbs"}}}'); assert.equal(template(), [ '```hbs', '', ' ', '
', ' ', '