Sha256: e8a74eff2b0a2922ef61f0808d8fbdf3114b8f3f939ebb9ddf2c3089e58bcf8d
Contents?: true
Size: 1.15 KB
Versions: 52
Compression:
Stored size: 1.15 KB
Contents
require 'spec_helper' describe Picky::Sources::Base do context 'with the base class' do let(:source) { described_class.new } describe 'connect_backend' do it 'exists' do source.connect_backend end end describe 'take_snapshot' do it 'exists and takes a single parameter' do source.take_snapshot :some_index end end end context 'with subclass' do let(:take_snapshot_called) { 0 } let(:subclass) do Class.new(described_class) do def take_snapshot index index.call index end end.new end describe 'with snapshot' do it 'is called only once when called in nested blocks' do index = stub :index, :identifier => :some_index subclass.stub! :timed_exclaim index.should_receive(:call).once.with index subclass.with_snapshot(index) do subclass.with_snapshot(index) do subclass.with_snapshot(index) do end end subclass.with_snapshot(index) do subclass.with_snapshot(index) do end end end end end end end
Version data entries
52 entries across 52 versions & 1 rubygems