var assert = require("assert"), Feed = require('../lib/feed.js') describe('RSS 2.0', function () { it('should return a standard feed', function () { var feed = new Feed({ title: 'Feed Title', description: 'This is my personnal feed!', link: 'http://example.com/', image: 'http://example.com/image.png', copyright: 'All rights reserved 2013, John Doe', updated: new Date('Sat, 13 Jul 2013 23:00:00 GMT'), // optional, default = today generator: 'awesome', // optional, default = 'Feed for Node.js' author: { name: 'John Doe', email: 'johndoe@example.com', link: 'https://example.com/johndoe' } }); var output = ''; output += '\n'; output += '\n'; output += ' \n'; output += ' Feed Title\n'; output += ' This is my personnal feed!\n'; output += ' http://example.com/\n'; output += ' Sat, 13 Jul 2013 23:00:00 GMT\n'; output += ' http://blogs.law.harvard.edu/tech/rss\n'; output += ' \n'; output += ' Feed Title\n'; output += ' http://example.com/image.png\n'; output += ' http://example.com/\n'; output += ' \n'; output += ' All rights reserved 2013, John Doe\n'; output += ' awesome\n'; output += ' \n'; output += ''; var data = feed.render('rss-2.0'); assert.equal(data, output); }); });