mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 05:16:39 +00:00
additional specs for Redistat::Buffer, still a few more needed
This commit is contained in:
@@ -51,7 +51,7 @@ describe Redistat::Buffer do
|
||||
@buffer.send(:reset_queue, true).should == {:hello => 'world'}
|
||||
end
|
||||
|
||||
it "should flush data into Summary.update properly" do
|
||||
it "should #flush_data into Summary.update properly" do
|
||||
# the root level key value doesn't actually matter, but it's something like this...
|
||||
data = {'ScopeName/label/goes/here:2011:nil:true:true' => {
|
||||
:key => mock("Key"),
|
||||
@@ -64,4 +64,12 @@ describe Redistat::Buffer do
|
||||
@buffer.send(:flush_data, data)
|
||||
end
|
||||
|
||||
it "should build #buffer_key correctly" do
|
||||
key = mock('Key', :to_s => "Scope/label:2011")
|
||||
opts = {:enable_grouping => true, :label_indexing => false, :connection_ref => nil}
|
||||
@buffer.send(:buffer_key, key, opts).should == "#{key.to_s}::true:false"
|
||||
opts = {:enable_grouping => false, :label_indexing => true, :connection_ref => :omg}
|
||||
@buffer.send(:buffer_key, key, opts).should == "#{key.to_s}:omg:false:true"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user