Sha256: 6c499a446bfe4402bb2d3df943471edcebdf3c29f9707d64cbd6e6d2e786acde

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'
require 'markdo/rss_command'

module Markdo
  describe RssCommand do
    it 'outputs RSS from the input Markdown' do
      out = StringIO.new
      err = StringIO.new
      env = { 'MARKDO_ROOT' => 'test/fixtures' }

      RssCommand.new(out, err, env).run

      xml_must_equal out.string, <<-XML
        <?xml version="1.0" encoding="UTF-8"?>
        <rss version="2.0">
          <channel>
            <title>Links in Markdo</title>
          <item>
            <title>Task with HTTP URL http://www.example.com/</title>
            <link>http://www.example.com/</link>
          </item>
          <item>
            <title>Task with HTTPS URL https://www.example.com/</title>
            <link>https://www.example.com/</link>
          </item>
          <item>
            <title>Task with HTTP URL http://www.example.com/ and trailing text</title>
            <link>http://www.example.com/</link>
          </item>
          </channel>
        </rss>
      XML
    end

    def xml_must_equal(actual, expected)
      actual.must_equal(expected.gsub(/^\s*/, ''))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
markdo-0.1.12.alpha test/rss_command_test.rb
markdo-0.1.11 test/rss_command_test.rb
markdo-0.1.10 test/rss_command_test.rb
markdo-0.1.9 test/rss_command_test.rb
markdo-0.1.8 test/rss_command_test.rb
markdo-0.1.7 test/rss_command_test.rb
markdo-0.1.6 test/rss_command_test.rb
markdo-0.1.5 test/rss_command_test.rb
markdo-0.1.4 test/rss_command_test.rb