Sha256: 76d6e4422abcab499282a492a006f4f493309dc93565fae29575c50f301a265d

Contents?: true

Size: 1.86 KB

Versions: 13

Compression:

Stored size: 1.86 KB

Contents

# coding: utf-8
require 'spec_helper'
require 'active_support/core_ext/numeric/time'
require 'xommelier/rss'

describe 'RSS feed' do
  describe 'parsing' do
    let(:rss_xml) { load_xml_file('feed.rss2.0') }
    let(:feed) { Xommelier::RSS::Rss.parse(rss_xml) }

    subject { feed }

    it { should be_kind_of(Xommelier::RSS::Rss) }

    its(:title) { should == 'Liftoff News' }
    its(:last_build_date) { should == Time.utc(2003, 6, 10, 9, 41, 01) }
    its(:pub_date) { should == Time.utc(2003, 6, 10, 04) }
    its(:description) { should == 'Liftoff to Space Exploration.' }
    its(:link) { should == URI.parse('http://liftoff.msfc.nasa.gov/') }
    its(:docs) { should == 'http://blogs.law.harvard.edu/tech/rss' }
    its(:description) { should == 'Liftoff to Space Exploration.' }
    its(:generator) { should == 'Weblog Editor 2.0' }
    its(:managing_editor) { should == 'editor@example.com' }
    its(:web_master) { should == 'webmaster@example.com' }

    it { feed.should have(4).items }
    describe 'Item' do
      let(:item) { feed.items[0] }
      subject { item }

      its(:guid) { should be_an Xommelier::RSS::Guid }
      its('guid.text') { should == 'http://liftoff.msfc.nasa.gov/2003/06/03.html#item573' }
      its('guid.to_s') { should == 'http://liftoff.msfc.nasa.gov/2003/06/03.html#item573' }
      its(:guid) { should == 'http://liftoff.msfc.nasa.gov/2003/06/03.html#item573' }
      its(:title) { should == 'Star City' }
      its(:pub_date) { should == Time.utc(2003, 6, 3, 9, 39, 21) }
      its(:description) { should == 'How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia\'s <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>.' }
      its(:link) { should == URI.parse('http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp') }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
xommelier-0.1.30 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.29 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.28 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.27 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.26 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.25 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.24 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.23 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.22 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.21 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.20 spec/functional/xommelier/rss/rss/parsing_spec.rb
xommelier-0.1.19 spec/functional/rss_feed_parsing_spec.rb
xommelier-0.1.18 spec/functional/rss_feed_parsing_spec.rb