Sha256: f5bf1dc7b9d5eea325fe581cec00bd12ccf312be627c154373bd725a8e47cedc
Contents?: true
Size: 936 Bytes
Versions: 10
Compression:
Stored size: 936 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe ProxyFetcher::Document::Adapters do describe '#lookup' do it 'returns predefined adapters if symbol or string passed' do expect(described_class.lookup('nokogiri')).to eq(ProxyFetcher::Document::NokogiriAdapter) expect(described_class.lookup(:oga)).to eq(ProxyFetcher::Document::OgaAdapter) end it 'returns self if class passed' do expect(described_class.lookup(Struct)).to eq(Struct) end it 'raises an exception if passed value is blank' do expect { described_class.lookup(nil) }.to raise_error(ProxyFetcher::Exceptions::BlankAdapter) expect { described_class.lookup('') }.to raise_error(ProxyFetcher::Exceptions::BlankAdapter) end it "raises an exception if adapter doesn't exist" do expect { described_class.lookup('wrong') }.to raise_error(ProxyFetcher::Exceptions::UnknownAdapter) end end end
Version data entries
10 entries across 10 versions & 1 rubygems