From cd62163152f19259138192850ff0a55b6389dc23 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 27 Sep 2010 14:58:17 +1000 Subject: [PATCH] remove redundant dummy date setting from Parser --- lib/validates_timeliness/parser.rb | 8 -------- spec/validates_timeliness/parser_spec.rb | 16 ---------------- 2 files changed, 24 deletions(-) diff --git a/lib/validates_timeliness/parser.rb b/lib/validates_timeliness/parser.rb index eac1b5d..272c66f 100644 --- a/lib/validates_timeliness/parser.rb +++ b/lib/validates_timeliness/parser.rb @@ -23,14 +23,6 @@ module ValidatesTimeliness cattr_accessor :ambiguous_year_threshold self.ambiguous_year_threshold = 30 - # Set the dummy date part for a time type value. Should be an array of 3 values - # being year, month and day in that order. - # - # Default: [ 2000, 1, 1 ] same as ActiveRecord - # - cattr_accessor :dummy_date_for_time_type - self.dummy_date_for_time_type = [ 2000, 1, 1 ] - # Format tokens: # y = year # m = month diff --git a/spec/validates_timeliness/parser_spec.rb b/spec/validates_timeliness/parser_spec.rb index 9902648..17bdbcb 100644 --- a/spec/validates_timeliness/parser_spec.rb +++ b/spec/validates_timeliness/parser_spec.rb @@ -177,22 +177,6 @@ describe ValidatesTimeliness::Parser do ValidatesTimeliness::Parser.ambiguous_year_threshold = default end end - - context "with custom dummy date values" do - before(:all) do - @old_dummy_date = ValidatesTimeliness.dummy_date_for_time_type - ValidatesTimeliness.dummy_date_for_time_type = [2009,1,1] - end - - it "should return time array with custom dummy date" do - time_array = formats._parse('12:13:14', :time, :strict => true) - time_array.should == [2009,1,1,12,13,14,0] - end - - after(:all) do - ValidatesTimeliness.dummy_date_for_time_type = @old_dummy_date - end - end end describe "parse" do