Sha256: 05d4784cfb1cffc4d053c8757f9eaf3b7454d03c5dd88b9305fadd94d186618f

Contents?: true

Size: 930 Bytes

Versions: 20

Compression:

Stored size: 930 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../../../spec_helper'
include OpenEHR::RM::DataTypes::Quantity::DateTime

describe DvTime do
  before(:each) do
    @dv_time = DvTime.new(:value => '11:17:30.2-0900')
  end

  it 'should be an instance of DvTime' do
    @dv_time.should be_an_instance_of DvTime
  end

  it 'hour should be 11' do
    @dv_time.hour.should == 11
  end

  it 'minute should be 17' do
    @dv_time.minute.should == 17
  end

  it 'second should be 30' do
    @dv_time.second.should == 30
  end

  it 'fractional_second should be 0.2' do
    @dv_time.fractional_second.should == 0.2
  end

  it 'timezone should be -0900' do
    @dv_time.timezone.should == '-0900'
  end

  it 'magnitude should 40650.2' do
    @dv_time.magnitude.should == 40650.2
  end
  
  it 'should be ' do
    diff_time = DvTime.new(:value => '15:36:48.05')
    @dv_time.diff(diff_time).value.should =='P0Y0M0W0DT4H19M17.85S'
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

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