<commit_before><commit_msg>Test cases for Publish element.<commit_after>var vows = require('vows');
var assert = require('assert');
var Publish = require('junction-pubsub/elements/publish');


vows.describe('Publish').addBatch({

  'when constructed with a node': {
    topic: function() {
      return new Publish('princely_musings');
    },
    
    'should have a node': function (publish) {
      assert.equal(publish.node, 'princely_musings');
    },
    'should build correct XML string': function(publish) {
      assert.equal(publish.toXML().toString(), '<publish node="princely_musings" xmlns="http://jabber.org/protocol/pubsub"/>');
    },
  },

}).export(module);
{'fraction_non_alphanumeric': 0.16468842729970326, 'fraction_numerical': 0.0, 'mean_word_length': 4.31496062992126, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '2242910', 'n_tokens_mistral': 206, 'n_tokens_neox': 201, 'n_words': 43}