Sha256: 27ecce964927eb7df2809da50c759edd061d3d0f828130397ba5ed9869354a18

Contents?: true

Size: 952 Bytes

Versions: 9

Compression:

Stored size: 952 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\. \d.\d(.\d)?, http://cerberus.rubyforge.org/</pre>}, 
                     xml.elements["rss/channel/item/description/"].get_text.value
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
cerberus-0.8.0 test/rss_publisher_test.rb
cerberus-0.7.9 test/rss_publisher_test.rb
edavis10-cerberus-0.7.8 test/rss_publisher_test.rb
cerberus-0.7.8 test/rss_publisher_test.rb
cerberus-0.7.7 test/rss_publisher_test.rb
cerberus-0.7.6 test/rss_publisher_test.rb
cerberus-0.7.2 test/rss_publisher_test.rb
cerberus-0.7.5 test/rss_publisher_test.rb
cerberus-0.7 test/rss_publisher_test.rb