- Timestamp:
- Sep 19, 2009, 5:03:22 PM (15 years ago)
- 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 31 31 end 32 32 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 33 42 describe 'year behavior' do 34 43 it 'should raise ArgumentError with nil year string' do … … 99 108 end 100 109 110 it '2009 should not be leap year' do 111 @iso8601date.should_not be_leapyear 2009 112 end 113 101 114 it '2009-02-28 should not raise ArgumentError' do 102 115 lambda{@iso8601date.day = 28}.should_not raise_error ArgumentError … … 113 126 end 114 127 128 it '2008 should be leap year' do 129 @iso8601date.should be_leapyear 2008 130 end 131 115 132 it '2008-02-29 should not raise ArgumentError' do 116 133 lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError … … 127 144 end 128 145 146 it 'should not leapyear' do 147 @iso8601date.should be_leapyear 2000 148 end 149 129 150 it '2000-02-29 should not raise ArgumentError' do 130 151 lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError … … 175 196 end 176 197 198 it 'constructor pass partial date' do 199 lambda { 200 ISO8601Date.new('2009-09') 201 }.should_not raise_error ArgumentError 202 end 203 177 204 after do 178 205 @iso8601date.day = 10 … … 191 218 }.should raise_error ArgumentError 192 219 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 193 230 end 194 231 end
Note:
See TracChangeset
for help on using the changeset viewer.