From cfbbb7d83a5d5ba00589cb51900bbf76ff7acd49 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 19 Jul 2010 12:31:04 +0300 Subject: [PATCH] updated Redistat::Key spec --- spec/key_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/key_spec.rb b/spec/key_spec.rb index 8e40e66..a5c3add 100644 --- a/spec/key_spec.rb +++ b/spec/key_spec.rb @@ -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