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

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

date_time test/unit moving to rspec

File size: 833 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2include OpenEHR::RM::DataTypes::Quantity::DateTime
3
4describe DvDate do
5 before(:each) do
6 @dv_date = DvDate.new(:value => '2009-09-28')
7 end
8
9 it 'should be an instance of DvDate' do
10 @dv_date.should be_an_instance_of DvDate
11 end
12
13 it 'value should be' do
14 @dv_date.value.should == '2009-09-28'
15 end
16
17 it 'year should be 2009' do
18 @dv_date.year.should be_equal 2009
19 end
20
21 it 'month should be 9' do
22 @dv_date.month.should be_equal 9
23 end
24
25 it 'day should be 28' do
26 @dv_date.day.should be_equal 28
27 end
28
29 it 'magnitude should 734045' do
30 @dv_date.magnitude.should == 734045
31 end
32
33 it 'diff should P0Y0M1W10D' do
34 diff_date = DvDate.new(:value => '2009-10-09')
35 @dv_date.diff(diff_date).value.should == 'P0Y0M1W11D'
36 end
37end
Note: See TracBrowser for help on using the repository browser.