| added epscs for DateTime extensions - reportable - Fork of reportable required … | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit e6ea4a8f5cae154c3ef76132a449d0b8117e9ace | |
| parent dce778951a2e3f254ecd0de4845dbf732c53ae2b | |
| Author: marcoow <[email protected]> | |
| Date: Fri, 12 Dec 2008 02:14:09 +0800 | |
| added epscs for DateTime extensions | |
| Signed-off-by: Marco Otte-Witte <[email protected]> | |
| Diffstat: | |
| M init.rb | 1 + | |
| A spec/other/date_time_spec.rb | 16 ++++++++++++++++ | |
| 2 files changed, 17 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/init.rb b/init.rb | |
| @@ -1,4 +1,5 @@ | |
| require 'kvlr/reports_as_sparkline' | |
| +require 'kvlr/core_extensions/date_time' | |
| ActiveRecord::Base.class_eval do | |
| include Kvlr::ReportsAsSparkline | |
| diff --git a/spec/other/date_time_spec.rb b/spec/other/date_time_spec.rb | |
| @@ -0,0 +1,16 @@ | |
| +require File.join(File.dirname(__FILE__), '..', 'spec_helper') | |
| + | |
| +describe DateTime do | |
| + | |
| + describe '.to_reporting_period' do | |
| + | |
| + it 'should return a reporting period for the specified grouping and instan… | |
| + date_time = DateTime.now | |
| + grouping = Kvlr::ReportsAsSparkline::Grouping.new(:hour) | |
| + | |
| + date_time.to_reporting_period(grouping).should == Kvlr::ReportsAsSparkli… | |
| + end | |
| + | |
| + end | |
| + | |
| +end |