updated Redistat::Key spec

This commit is contained in:
2010-07-19 12:31:04 +03:00
parent 9403aacd96
commit cfbbb7d83a

View File

@@ -4,7 +4,7 @@ describe Redistat::Key do
before(:each) do
@scope = "PageViews"
@label = "/about/us"
@label = "about_us"
@label_hash = Digest::SHA1.hexdigest(@label)
@now = Time.now
@key = Redistat::Key.new(@scope, @label, @now, {:depth => :day})
@@ -29,7 +29,9 @@ describe Redistat::Key do
end
it "should abide to hash_label option" do
@label = "about_us"
@key = Redistat::Key.new(@scope, @label, @now, {:depth => :day, :hash_label => true})
@key.to_s.should == "#{@scope}/#{@label_hash}:#{@key.date.to_s(:day)}"
@key = Redistat::Key.new(@scope, @label, @now, {:depth => :day, :hash_label => false})
@key.to_s.should == "#{@scope}/#{@label}:#{@key.date.to_s(:day)}"
end