Changeset 280


Ignore:
Timestamp:
Sep 19, 2009, 5:03:22 PM (11 years ago)
Author:
KOBAYASHI, Shinji
Message:

date and time are seeds of headache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/iso_8601_date_spec.rb

    r259 r280  
    3131  end
    3232
     33  it 'should parse vaild date form' do
     34
     35  end
     36
     37
     38  it 'should not parse invalid date form' do
     39    ISO8601Date.valid_iso8601_date?('2009-13-54').should_not be_true
     40  end
     41
    3342  describe 'year behavior' do
    3443    it 'should raise ArgumentError with nil year string' do
     
    99108      end
    100109
     110      it '2009 should not be leap year' do
     111        @iso8601date.should_not be_leapyear 2009
     112      end
     113
    101114      it '2009-02-28 should not raise ArgumentError' do
    102115        lambda{@iso8601date.day = 28}.should_not raise_error ArgumentError
     
    113126      end
    114127
     128      it '2008 should be leap year' do
     129        @iso8601date.should be_leapyear 2008
     130      end
     131
    115132      it '2008-02-29 should not raise ArgumentError' do
    116133        lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError
     
    127144      end
    128145
     146      it 'should not leapyear' do
     147        @iso8601date.should be_leapyear 2000
     148      end
     149
    129150      it '2000-02-29 should not raise ArgumentError' do
    130151        lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError
     
    175196      end
    176197     
     198      it 'constructor pass partial date' do
     199        lambda {
     200          ISO8601Date.new('2009-09')
     201        }.should_not raise_error ArgumentError
     202      end
     203
    177204      after do
    178205        @iso8601date.day = 10
     
    191218        }.should raise_error ArgumentError
    192219      end
     220
     221      it 's as_string should be 2009' do
     222        @iso8601date.as_string.should == '2009'
     223      end
     224
     225      it 'constructor pass only year data' do
     226        lambda {
     227          ISO8601Date.new('2009')
     228        }.should_not raise_error ArgumentError
     229      end
    193230    end
    194231  end
Note: See TracChangeset for help on using the changeset viewer.