Sha256: 93b82ee8365395a50f3895c466a9272a40328b7eda07fc76dfc4042943c820bd

Contents?: true

Size: 971 Bytes

Versions: 2

Compression:

Stored size: 971 Bytes

Contents

require 'spec_helper'

describe Wombat do
	it 'should provide syntactic sugar method Wombat.crawl' do
		Wombat.should respond_to(:crawl)
	end

	it 'should provide syntactic sugar method Wombat.scrape' do
		Wombat.should respond_to(:scrape)
	end

	it 'should redirect .scrape to .crawl' do
		fake_class = double :fake
		fake_class.stub :include
		fake_class.should_receive(:new).and_return(double(crawl: nil))
		Class.stub :new => fake_class
		Wombat.scrape
	end

	it 'should provide configuration method with block' do
		Wombat.configure do |config|
			config.set_proxy "10.0.0.1", 8080
		end
		Wombat.proxy_args.should == ["10.0.0.1", 8080]
	end

	it 'should accept regular properties (non-selectors)' do
		VCR.use_cassette('broken_selector') do
			lambda {
				Wombat.crawl do
					base_url "http://www.github.com"
		  		path "/"

		  		source :obaoba
			    description 'Oba Oba'
			    website 'http://obaoba.com.br'
				end
			}.should_not raise_error
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wombat-2.3.0 spec/wombat_spec.rb
wombat-2.2.1 spec/wombat_spec.rb