Sha256: 7811c9b0516be91f47980b31ac33c30e9f94843ad4748b6e3b31bb3c9acb20d1
Contents?: true
Size: 750 Bytes
Versions: 1
Compression:
Stored size: 750 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 = mock(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) @search_session.stub(method).and_raise(e) @proxy.should_receive(:rescued_exception).with(method, e) @proxy.send(method) end end it_should_behave_like 'session proxy' end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sunspot-2.1.0 | spec/api/session_proxy/silent_fail_session_proxy_spec.rb |