angular.js/docs/spec/writerSpec.js
Vojta Jina 8978e066b5 fix(gen-docs): require files without touching PATH
So that it works on latest revision of node...
New version of Node (v0.5.x) does not support require.paths.push().
2011-10-18 22:23:52 -07:00

34 lines
881 B
JavaScript

var writer = require('../src/writer.js');
describe('writer', function() {
describe('toString', function() {
var toString = writer.toString;
it('should merge string', function() {
expect(toString('abc')).toEqual('abc');
});
it('should merge obj', function() {
expect(toString({a:1})).toEqual('{"a":1}');
});
it('should merge array', function() {
expect(toString(['abc',{}])).toEqual('abc{}');
});
});
describe('replace method', function() {
var content,
replacements;
beforeEach(function() {
content = 'angular super jQuery manifest';
});
it('should replace placeholders', function() {
replacements = {'angular': 'ng', 'jQuery': 'jqlite','notHere': 'here'};
content = writer.replace(content, replacements);
expect(content).toBe('ng super jqlite manifest');
});
});
});