require File.join(File.dirname(__FILE__), %w[.. .. spec_helper]) describe Feedzirra::FeedUtilities do before do @klass = Class.new do include Feedzirra::FeedEntryUtilities end end describe "new_entry?" do it "should default to being a new entry" do @klass.new.new_entry?.should be_true end end describe "#mark_old!" do before do @entry = @klass.new end it "should make new_entry? return false" do @entry.new_entry?.should be_true @entry.mark_old! @entry.new_entry?.should be_false end end describe "#mark_new!" do before do @entry = @klass.new end it "should make new_entry? return true" do @entry.new_entry?.should be_true @entry.mark_old! @entry.new_entry?.should be_false @entry.mark_new! @entry.new_entry?.should be_true end end describe "handling dates" do it "should parse an ISO 8601 formatted datetime into Time" do time = @klass.new.parse_datetime("2008-02-20T8:05:00-010:00") time.class.should == Time time.to_s.should == "Wed Feb 20 18:05:00 UTC 2008" end end describe "sanitizing" do before do @feed = Feedzirra::FeedParser.new(sample_atom_feed).run @entry = @feed.entries.first end it "should provide a sanitized title" do new_title = "