allow date/time and label to be changed on

Redistat::Key and Redistat::Event objects
This commit is contained in:
2010-07-19 17:53:00 +03:00
parent cfbbb7d83a
commit 249a4b5cfd
4 changed files with 89 additions and 28 deletions

View File

@@ -4,12 +4,33 @@ describe Redistat::Event do
before(:each) do
@scope = "PageViews"
@label = "/about/us"
@label = "about_us"
@label_hash = Digest::SHA1.hexdigest(@label)
@now = Time.now
@event = Redistat::Event.new(@scope, @label, {:views => 1}, @now, {:depth => :hour})
@date = Time.now
@event = Redistat::Event.new(@scope, @label, {:views => 1}, @date, {:depth => :hour})
end
it "should initialize properly"
# it "should initialize properly"
it "should allow changing Date" do
@event.time.should == @date
@date = Time.now
@event.date = @date
@event.time.should == @date
end
it "should allow changing Label" do
@event.label.should == @label
@event.label_hash.should == @label_hash
@label = "contact_us"
@label_hash = Digest::SHA1.hexdigest(@label)
@event.label = @label
@event.label.should == @label
@event.label_hash.should == @label_hash
end
end