spec/model_spec.rb in redistat-0.0.6 vs spec/model_spec.rb in redistat-0.0.7

- old
+ new

@@ -6,10 +6,11 @@ before(:each) do ModelHelper1.redis.flushdb ModelHelper2.redis.flushdb ModelHelper3.redis.flushdb + ModelHelper4.redis.flushdb end it "should should name itself correctly" do ModelHelper1.send(:name).should == "ModelHelper1" ModelHelper2.send(:name).should == "ModelHelper2" @@ -17,10 +18,11 @@ it "should listen to model-defined options" do ModelHelper2.depth.should == :day ModelHelper2.store_event.should == true ModelHelper2.hashed_label.should == true + ModelHelper2.class_name.should be_nil ModelHelper1.depth.should == nil ModelHelper1.store_event.should == nil ModelHelper1.hashed_label.should == nil ModelHelper1.depth(:hour) @@ -33,9 +35,12 @@ ModelHelper1.options[:store_event] = nil ModelHelper1.options[:hashed_label] = nil ModelHelper1.depth.should == nil ModelHelper1.store_event.should == nil ModelHelper1.hashed_label.should == nil + + ModelHelper4.class_name.should == "FancyHelper" + ModelHelper4.send(:name).should == "FancyHelper" end it "should store and fetch stats" do ModelHelper1.store("sheep.black", {:count => 6, :weight => 461}, 4.hours.ago) ModelHelper1.store("sheep.black", {:count => 2, :weight => 156})