spec/riak/bucket_spec.rb in riak-client-0.9.4 vs spec/riak/bucket_spec.rb in riak-client-0.9.5
- old
+ new
@@ -55,9 +55,20 @@
@bucket.keys do |list|
all_keys.concat(list)
end
all_keys.should == ["bar", "baz"]
end
+
+ it "should invalidate the key cache when streaming" do
+ @backend.should_receive(:list_keys).once.and_return(['a'])
+ @backend.should_receive(:list_keys).once.and_yield(['b'])
+ @backend.should_receive(:list_keys).once.and_return(['c'])
+ @bucket.keys.should == ['a']
+ keys = []
+ @bucket.keys {|kl| keys.concat(kl) }
+ keys.should == ['b']
+ @bucket.keys.should == ['c']
+ end
end
describe "setting the bucket properties" do
it "should prefetch the properties when they are not present" do
@backend.stub!(:set_bucket_props)