Sha256: 94311171e97822b3d6b81b7a56f070caf9d59caa3181e5ac1a60bd37b8b468a6
Contents?: true
Size: 769 Bytes
Versions: 7
Compression:
Stored size: 769 Bytes
Contents
require File.expand_path('spec_helper', File.dirname(__FILE__)) describe Sunspot::SessionProxy::ShardingSessionProxy do FakeException = Class.new(StandardError) SUPPORTED_METHODS = Sunspot::SessionProxy::SilentFailSessionProxy::SUPPORTED_METHODS before do @search_session = double(Sunspot::Session.new) @proxy = Sunspot::SessionProxy::SilentFailSessionProxy.new(@search_session) end it "should call rescued_exception when an exception is caught" do SUPPORTED_METHODS.each do |method| e = FakeException.new(method) allow(@search_session).to receive(method).and_raise(e) expect(@proxy).to receive(:rescued_exception).with(method, e) @proxy.send(method) end end it_should_behave_like 'session proxy' end
Version data entries
7 entries across 7 versions & 1 rubygems