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

Version Path
openehr-1.2.8 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.7 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.6 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.5 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.4 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.3 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.2 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.1 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.2.0 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.6 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.5 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.4 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.3 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.2 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.1 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb
openehr-1.1.0 spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb