added grouping support to Redistat::Label

This commit is contained in:
2011-03-04 16:25:31 +00:00
parent fe221c3f31
commit 15904e8a94
2 changed files with 29 additions and 2 deletions

View File

@@ -25,4 +25,17 @@ describe Redistat::Label do
db.get("#{Redistat::KEY_LEBELS}#{label.hash}").should == name
end
it "should separate label names into groups" do
name = "message/public/offensive"
label = Redistat::Label.new(name)
label.name.should == name
label.groups.should == [ "message/public/offensive",
"message/public",
"message" ]
name = "message"
label = Redistat::Label.new(name)
label.name.should == name
label.groups.should == [ "message" ]
end
end