source: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/date_time/dv_time_spec.rb@ 322

Last change on this file since 322 was 322, checked in by KOBAYASHI, Shinji, 15 years ago

common/generic near completed

File size: 841 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2include OpenEHR::RM::DataTypes::Quantity::DateTime
3
4describe DvTime do
5 before(:each) do
6 @dv_time = DvTime.new(:value => '11:17:30.2')
7 end
8
9 it 'should be an instance of DvTime' do
10 @dv_time.should be_an_instance_of DvTime
11 end
12
13 it 'hour should be 11' do
14 @dv_time.hour.should == 11
15 end
16
17 it 'minute should be 17' do
18 @dv_time.minute.should == 17
19 end
20
21 it 'second should be 30' do
22 @dv_time.second.should == 30
23 end
24
25 it 'fractional_second should be 0.2' do
26 @dv_time.fractional_second.should == 0.2
27 end
28
29 it 'magnitude should 40650.2' do
30 @dv_time.magnitude.should == 40650.2
31 end
32
33 it 'should be ' do
34 diff_time = DvTime.new(:value => '15:36:48.05')
35 @dv_time.diff(diff_time).value.should =='P0Y0M0W0DT4H19M17.85S'
36 end
37end
Note: See TracBrowser for help on using the repository browser.