mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
allow date/time and label to be changed on
Redistat::Key and Redistat::Event objects
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user