Sha256: 63f6bce41bad8326b0998a1f1917a1ef9470d7e7881786d543c2a79db0811f1b

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 Bytes

Contents

require 'spec_helper'

describe ProxyFetcher::Proxy do
  before :all do
    @manager = ProxyFetcher::Manager.new
  end

  let(:proxy) { @manager.proxies.first }

  it 'checks schema' do
    expect(proxy.http?).to be_falsey.or(be_truthy)
    expect(proxy.https?).to be_falsey.or(be_truthy)
  end

  it 'checks connection status' do
    allow_any_instance_of(ProxyFetcher::Proxy).to receive(:addr).and_return('192.168.1.1')
    expect(proxy.connectable?).to be_falsey
  end

  it 'returns URI::Generic' do
    expect(proxy.uri).to be_a(URI::Generic)
  end

  it 'returns URL' do
    expect(proxy.url).to be_a(String)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proxy_fetcher-0.1.1 spec/proxy_fetcher/proxy_spec.rb
proxy_fetcher-0.1.0 spec/proxy_fetcher/proxy_spec.rb