Changeset 284


Ignore:
Timestamp:
Sep 20, 2009, 8:10:17 PM (10 years ago)
Author:
KOBAYASHI, Shinji
Message:

TimeDefinition? completed

File:
1 edited

Legend:

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

    r281 r284  
    5151    end
    5252
    53     it 'shoudl be invalid nil 09 19' do
     53    it 'should be invalid nil 09 19' do
    5454      TimeDefinitions.should_not be_valid_day(nil, 9, 19)
     55    end
     56
     57    it 'should be valid 2009 09' do
     58      TimeDefinitions.should be_valid_day(2009,9,nil)
    5559    end
    5660  end
    5761
    58   describe 'hour behavior'
     62  describe 'hour behavior' do
     63    it 'should be valid hour 0,0,0' do
     64      TimeDefinitions.should be_valid_hour(0,0,0)
     65    end
     66
     67    it 'should be valid hour 12,59,59' do
     68      TimeDefinitions.should be_valid_hour(12,59,59)
     69    end
     70
     71    it 'should not be valid hour 12,60,59' do
     72      TimeDefinitions.should_not be_valid_hour(12,60,59)
     73    end
     74
     75    it 'should not be valid hour 12,59,60' do
     76      TimeDefinitions.should_not be_valid_hour(12,59,60)
     77    end
     78
     79    it 'should be valid hour 24,0,0' do
     80      TimeDefinitions.should be_valid_hour(24,0,0)
     81    end
     82
     83    it 'should not be valid hour 24,0,1' do
     84      TimeDefinitions.should_not be_valid_hour(24,0,1)
     85    end
     86
     87
     88    it 'should be vaild hour 12,1' do
     89      TimeDefinitions.should be_valid_hour(12,1)
     90    end
     91
     92    it 'should not be valid hour 12,nil,1' do
     93      TimeDefinitions.should be_valid_hour(12,nil,1)
     94    end
     95
     96    it 'should be valid hour 12' do
     97      TimeDefinitions.should be_valid_hour(12)
     98    end
     99  end
     100
     101  describe 'minute limit' do
     102    it 'should be more than 0' do
     103      TimeDefinitions.should be_valid_minute 0
     104    end
     105
     106    it 'should be not less than 0' do
     107      TimeDefinitions.should_not be_valid_minute -1
     108    end
     109
     110    it 'should less than 60' do
     111      TimeDefinitions.should be_valid_minute 59
     112    end
     113
     114    it 'should not valid minute 60' do
     115      TimeDefinitions.should_not be_valid_minute 60
     116    end
     117  end
     118
     119  describe 'second limit' do
     120    it 'should be more than 0' do
     121      TimeDefinitions.should be_valid_second 0
     122    end
     123
     124    it 'should be not less than 0' do
     125      TimeDefinitions.should_not be_valid_second -1
     126    end
     127
     128    it 'should less than 60' do
     129      TimeDefinitions.should be_valid_second 59
     130    end
     131
     132    it 'should not valid minute 60' do
     133      TimeDefinitions.should_not be_valid_second 60
     134    end
     135  end
    59136end
Note: See TracChangeset for help on using the changeset viewer.