Sha256: 2b076f84746dc1228cf57e96ceccdac9b50f7c725f75cc977837df9a79d11229

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. spec_helper])

describe Scrapzirra::Injector do
  let(:feed) do
    Feedjira::Parser::Atom.parse(sample_atom_feed)
  end

  let(:injector) { Scrapzirra::Injector.new feed}

  let(:injected_feed) { injector.feed }

  subject { injected_feed }

  its(:title) { should eq("Amazon Web Services Blog")}
  its(:url) { should eq("http://aws.typepad.com/aws/")}

  describe '.scrap' do
    its(:"scrap.class") { should be(Scrapzirra::Scrap)}
    describe '.doc' do
      subject { injected_feed.scrap.doc }
      its(:class){ should be(Nokogiri::HTML::Document)}
    end
  end

  describe '.entries' do
    subject { feed.entries.first }
    its(:url) { should eq("http://aws.typepad.com/aws/2009/01/aws-job-architect-designer-position-in-turkey.html")}
    its(:"scrap.class") { should be(Scrapzirra::Scrap)}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scrapzirra-0.0.6 spec/scrapzirra/injector_spec.rb