From f906cf068e4ac45a586a006d2135c71985a1e81c Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 28 Nov 2010 11:52:05 +0000 Subject: [PATCH] added a spec for Collection#total --- lib/redistat/collection.rb | 4 ++++ spec/collection_spec.rb | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/redistat/collection.rb b/lib/redistat/collection.rb index a8feaf7..d54654d 100644 --- a/lib/redistat/collection.rb +++ b/lib/redistat/collection.rb @@ -12,5 +12,9 @@ module Redistat @depth = options[:depth] ||= nil end + def total + @total ||= {} + end + end end \ No newline at end of file diff --git a/spec/collection_spec.rb b/spec/collection_spec.rb index 48938bb..74f040f 100644 --- a/spec/collection_spec.rb +++ b/spec/collection_spec.rb @@ -10,4 +10,11 @@ describe Redistat::Collection do result.depth.should == options[:depth] end + it "should have a total property" do + col = Redistat::Collection.new() + col.total.should == {} + col.total = {:foo => "bar"} + col.total.should == {:foo => "bar"} + end + end \ No newline at end of file