spec/functional/xommelier/rss/rss/parsing_spec.rb in xommelier-0.1.30 vs spec/functional/xommelier/rss/rss/parsing_spec.rb in xommelier-0.1.31
- old
+ new
@@ -1,17 +1,21 @@
# coding: utf-8
+
+################################################
+# © Alexander Semyonov, 2011—2013, MIT License #
+# Author: Alexander Semyonov <al@semyonov.us> #
+################################################
+
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) { 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) }
@@ -23,11 +27,10 @@
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 }
+ subject(:item) { feed.items[0] }
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' }