Sha256: dfcc36593387d39f24759f1cdeef747ff4521828c55382d1aa7b057c80d1aca5

Contents?: true

Size: 949 Bytes

Versions: 5

Compression:

Stored size: 949 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

require 'cerberus/publisher/rss'
require 'mock/manager'
require 'tempfile'
require 'rexml/document'

class RSSPublisherTest < Test::Unit::TestCase
  def test_publisher
    rss_file = Tempfile.new('cerberus-rss')
    options = Cerberus::Config.new(nil, :publisher => {:rss => {:file => rss_file.path}}, :application_name => 'RSS<App')
    build = DummyManager.new('last message', 'this is output', 1235, 'anatol')

    Cerberus::Publisher::RSS.publish(build_status(false), build, options)

    xml = REXML::Document.new(IO.read(rss_file.path))

    assert_equal '[RSS<App] Build still broken (#1235)', xml.elements["rss/channel/item/title/"].get_text.value
    assert_match %r{<pre>last message\nthis is output\n--\nThis email generated by Cerberus tool ver\. 0.\d.\d, http://cerberus.rubyforge.org/</pre>}, 
                     xml.elements["rss/channel/item/description/"].get_text.value
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cerberus-0.4.2 test/rss_publisher_test.rb
cerberus-0.4.3 test/rss_publisher_test.rb
cerberus-0.4.4 test/rss_publisher_test.rb
cerberus-0.4.5.1 test/rss_publisher_test.rb
cerberus-0.4.5 test/rss_publisher_test.rb