From 93360dbeb980448d5e671ad4d74e24c747671c80 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Tue, 28 Dec 2010 23:55:39 +0000 Subject: [PATCH] Specs pass again - problem with Time.now resolution surpassing that provided by values stored in a Redistat::Date, truncated to seconds by using to_s, which is accurate enough for testing purposes --- spec/event_spec.rb | 6 +++--- spec/key_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/event_spec.rb b/spec/event_spec.rb index 14fd9e5..3550c59 100644 --- a/spec/event_spec.rb +++ b/spec/event_spec.rb @@ -20,7 +20,7 @@ describe Redistat::Event do @event.scope.should == @scope @event.label.should == @label @event.label_hash.should == @label_hash - @event.date.to_time.should == @date + @event.date.to_time.to_s.should == @date.to_s @event.stats.should == @stats @event.meta.should == @meta @event.options.should == @event.default_options.merge(@options) @@ -28,10 +28,10 @@ describe Redistat::Event do it "should allow changing attributes" do # date - @event.date.to_time.should == @date + @event.date.to_time.to_s.should == @date.to_s @date = Time.now @event.date = @date - @event.date.to_time.should == @date + @event.date.to_time.to_s.should == @date.to_s # label @event.label.should == @label @event.label_hash.should == @label_hash diff --git a/spec/key_spec.rb b/spec/key_spec.rb index bb2cd20..9d8bec4 100644 --- a/spec/key_spec.rb +++ b/spec/key_spec.rb @@ -46,10 +46,10 @@ describe Redistat::Key do @key.scope = @scope @key.scope.should == @scope # date - @key.date.to_time.should == @date + @key.date.to_time.to_s.should == @date.to_s @date = Time.now @key.date = @date - @key.date.to_time.should == @date + @key.date.to_time.to_s.should == @date.to_s # label @key.label.should == @label @key.label_hash == @label_hash