<commit_before>/*
    use `npm test` to run tests using mocha
*/

var RSS = require('../lib/rss');
var expect = require('chai').expect;

describe('rss module', function(done) {

    it('should work with an empty feed', function(done) {
        var feed = new RSS();
        expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylan/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate></channel></rss>');
        feed.item();
        expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylan/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate><item><title><![CDATA[No title]]></title><guid isPermaLink="false">No title</guid></item></channel></rss>');
        done();
    });

    it('should work with an easy test', function(done) {
        var feed = new RSS({
                    title: 'title',
                    description: 'description',
                    generator: 'Example Generator',
                    feed_url: 'http://example.com/rss.xml',
                    site_url: 'http://example.com',
                    image_url: 'http://example.com/icon.png',
                    author: '<NAME>',
                    categories: ['Category 1','Category 2','Category 3'],
                    pubDate: 'May 20, 2012 04:00:00 GMT',
                    docs: 'http://example.com/rss/docs.html',
                    copyright: '2013 D<NAME>',
                    language: 'en',
                    managingEditor: 'Dy<NAME>',
                    webMaster: 'Dy<NAME>',
                    ttl: '60'
                });

        feed.item({
                    title:  'item 1',
                    description: 'description 1',
                    url: 'http://example.com/article1',
                    date: 'May 24, 2012 04:00:00 GMT'
                })
            .item({<commit_msg>+2 “dylan” → “dylang”<commit_after>/*
    use `npm test` to run tests using mocha
*/

var RSS = require('../lib/rss');
var expect = require('chai').expect;

describe('rss module', function(done) {

    it('should work with an empty feed', function(done) {
        var feed = new RSS();
        expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylang/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate></channel></rss>');
        feed.item();
        expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylang/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate><item><title><![CDATA[No title]]></title><guid isPermaLink="false">No title</guid></item></channel></rss>');
        done();
    });

    it('should work with an easy test', function(done) {
        var feed = new RSS({
                    title: 'title',
                    description: 'description',
                    generator: 'Example Generator',
                    feed_url: 'http://example.com/rss.xml',
                    site_url: 'http://example.com',
                    image_url: 'http://example.com/icon.png',
                    author: '<NAME>',
                    categories: ['Category 1','Category 2','Category 3'],
                    pubDate: 'May 20, 2012 04:00:00 GMT',
                    docs: 'http://example.com/rss/docs.html',
                    copyright: '2013 <NAME>',
                    language: 'en',
                    managingEditor: 'Dylan Green',
                    webMaster: 'Dylan Green',
                    ttl: '60'
                });

        feed.item({
                    title:  'item 1',
                    description: 'description 1',
                    url: 'http://example.com/article1',
                    date: 'May 24, 2012 04:00:00 GMT'
                })
            .item({
{'fraction_non_alphanumeric': 0.19195289499509322, 'fraction_numerical': 0.025318940137389598, 'mean_word_length': 2.296248382923674, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 4, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7083155', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1482, 'n_words': 268}