Sha256: 843c0f33a8819a598c2e5b8394802df5434b47153d999ccc67eca8a65522c190

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

describe Rawler::Crawler do
  
  context "http basic" do
    
    let(:url)     { 'http://example.com' }
    let(:content) { '<a href="http://example.com/secret-path">foo</a>' }
    let(:crawler) { Rawler::Crawler.new('http://example.com/secret') }
    
    before(:each) do
      register('http://example.com/secret', '', :status => ["401", "Unauthorized"])
      register('http://foo:bar@example.com/secret', content)

      Rawler.stub!(:username).and_return('foo')
      Rawler.stub!(:password).and_return('bar')
    end
   
    it "should crawl http basic pages" do
      crawler.links.should == ['http://example.com/secret-path']
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rawler-0.0.5 spec/unit/crawler/http_basic_spec.rb