date_ranger 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,8 @@ module DateRanger::Bootstrapper
3
3
  def has_date_range(options={})
4
4
  class_attribute :date_ranger_options
5
5
  self.date_ranger_options = options
6
+ self.date_ranger_options[:default_start_date] ||= lambda { Date.today }
7
+ self.date_ranger_options[:default_end_date] ||= lambda { Date.today }
6
8
  self.date_ranger_options[:timestep] ||= :daily
7
9
  if self.date_ranger_options[:class]
8
10
  extend DateRanger
@@ -1,3 +1,3 @@
1
1
  module DateRanger
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -73,6 +73,14 @@ describe DateRanger do
73
73
  end
74
74
  end
75
75
 
76
+ context 'when default dates are not overridden' do
77
+ it 'should both be today' do
78
+ something = Something.new
79
+ something.start_date.should == Date.today
80
+ something.end_date.should == Date.today
81
+ end
82
+ end
83
+
76
84
  describe "#end_date" do
77
85
  it 'should return date given a string' do
78
86
  Something.has_date_range
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_ranger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: