Sha256: f20c34161da236177c8d10b297d85eccd8f5627d33eb534d5e773a7692e0d897
Contents?: true
Size: 741 Bytes
Versions: 9
Compression:
Stored size: 741 Bytes
Contents
require 'spec_helper' describe Praxis::Mapper::ConnectionFactories::Simple do let(:connection) { double("connection") } let(:connection_manager) { double('Praxis::Mapper::ConnectionManager') } context 'with a raw connection' do subject(:factory) { described_class.new(connection:connection) } it 'returns the connection on checkout' do factory.checkout(connection_manager).should be connection end end context 'with a proc' do let(:block) { Proc.new { connection } } subject(:factory) { described_class.new(&block) } it 'calls the block on checkout' do block.should_receive(:call).and_call_original factory.checkout(connection_manager).should be connection end end end
Version data entries
9 entries across 9 versions & 1 rubygems