spec/lib/backends/redis/directly_manipulable_spec.rb in picky-4.19.4 vs spec/lib/backends/redis/directly_manipulable_spec.rb in picky-4.19.5
- old
+ new
@@ -1,11 +1,11 @@
require 'spec_helper'
describe Picky::Backends::Redis::DirectlyManipulable do
- let(:client) { stub :client }
- let(:backend) { stub :backend, client: client, namespace: 'some:namespace' }
+ let(:client) { double :client }
+ let(:backend) { double :backend, client: client, namespace: 'some:namespace' }
let(:list) do
list = [1,2]
described_class.make backend, list, 'some:key'
list
end
@@ -22,11 +22,11 @@
end
end
context 'stubbed backend' do
before(:each) do
- backend.stub! :[]
+ backend.stub :[]
end
it 'calls the right client method' do
num = described_class.class_variable_get(:@@append_index)
client.should_receive(:zadd).once.with "some:namespace:some:key", num+1, 3
@@ -52,12 +52,12 @@
end
end
context 'stubbed client' do
before(:each) do
- client.stub! :zadd
- client.stub! :zrem
+ client.stub :zadd
+ client.stub :zrem
end
it 'calls [] at the end of the method' do
backend.should_receive(:[]).once.with 'some:key'
list << 3
@@ -72,12 +72,12 @@
end
end
context 'stubbed client/backend' do
before(:each) do
- backend.stub! :[]
- client.stub! :zadd
- client.stub! :zrem
+ backend.stub :[]
+ client.stub :zadd
+ client.stub :zrem
end
it 'behaves like an ordinary Array' do
list << 3
list.should == [1,2,3]
\ No newline at end of file