mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
added label grouping to Key and Summary classes
This commit is contained in:
@@ -14,6 +14,7 @@ describe Redistat::Key do
|
||||
@key.scope.should == @scope
|
||||
@key.label.should == @label
|
||||
@key.label_hash.should == @label_hash
|
||||
@key.label_groups.should == @key.instance_variable_get("@label").groups
|
||||
@key.date.should be_instance_of(Redistat::Date)
|
||||
@key.date.to_time.to_s.should == @date.to_s
|
||||
end
|
||||
@@ -60,4 +61,16 @@ describe Redistat::Key do
|
||||
@key.label_hash == @label_hash
|
||||
end
|
||||
|
||||
it "should create a group of keys from label group" do
|
||||
label = 'message/public/offensive'
|
||||
result = [ "message/public/offensive",
|
||||
"message/public",
|
||||
"message" ]
|
||||
|
||||
key = Redistat::Key.new(@scope, label, @date, {:depth => :hour})
|
||||
|
||||
key.label_groups.should == result
|
||||
key.groups.map { |k| k.label }.should == result
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user