Sha256: a21a7cefce2d4fb6f55d5bc69f88c77525de9ca4e82b48f809d47edd50b16914
Contents?: true
Size: 851 Bytes
Versions: 16
Compression:
Stored size: 851 Bytes
Contents
require File.dirname(__FILE__) + '/../../../../../../spec_helper' require 'openehr/rm/data_types/quantity/date_time' include OpenEHR::RM::DataTypes::Quantity::DateTime describe DvDateTime do before(:each) do @dv_date_time = DvDateTime.new(:value => '2009-09-29T15:03:22.3Z') end it 'should be an instance of DvDateTime' do @dv_date_time.should be_an_instance_of DvDateTime end it 'magnitude should be 63423697018.3' do @dv_date_time.magnitude.should be_within(0.01).of(63423697018.3) end it 'should be equal when magnitude is same' do @dv_date_time.should == DvDateTime.new(:value => '2009-09-29T15:03:22.3Z') end it 'diff should be caluculated from past to future' do future = DvDateTime.new(:value => '2009-10-29T16:23:30.3Z') @dv_date_time.diff(future).value.should == 'P0Y1M0W0DT1H20M8.0S' end end
Version data entries
16 entries across 16 versions & 1 rubygems