Sha256: 9013942ceef843779ed02033c97ee531a36c232ea9f17703806ee9f33854f2c0

Contents?: true

Size: 1.81 KB

Versions: 26

Compression:

Stored size: 1.81 KB

Contents

require File.dirname(__FILE__) + '/../../../../../spec_helper'
include OpenEHR::RM::Common::Archetyped
include OpenEHR::RM::DataTypes::Encapsulated
include OpenEHR::RM::DataTypes::Basic

describe FeederAudit do
  before(:each) do
    originating_system_audit = stub(FeederAuditDetails, :system_id => 'CASPAR')
    originating_system_item_ids = stub(Array, :size => 10)
    feeder_system_audit = stub(FeederAuditDetails, :system_id => 'BARTHASAR')
    feeder_system_item_ids = stub(Array, :size => 5)
    original_content = stub(DvEncapsulated, :charset => 'UTF-8')
    @feeder_audit = FeederAudit.new(
       :originating_system_audit => originating_system_audit,
       :originating_system_item_ids => originating_system_item_ids,
       :feeder_system_audit => feeder_system_audit,
       :feeder_system_item_ids => feeder_system_item_ids,
       :original_content => original_content)
  end

  it 'should be an instance of FeederAudit' do
    @feeder_audit.should be_an_instance_of FeederAudit
  end

  it 'originating_system_audit.system_id should be CASPAR' do
    @feeder_audit.originating_system_audit.system_id.should == 'CASPAR'
  end

  it 'originating_system_item_ids.size should be equal 10' do
    @feeder_audit.originating_system_item_ids.size.should be_equal 10
  end

  it 'feeder_system_audit.system_id should BARTHASAR' do
    @feeder_audit.feeder_system_audit.system_id.should == 'BARTHASAR'
  end

  it 'feeder_system_item_ids.size should be equal 5' do
    @feeder_audit.feeder_system_item_ids.size.should be_equal 5
  end

  it 'original_content.charset should be UTF-8' do
    @feeder_audit.original_content.charset.should == 'UTF-8'
  end

  it 'should raise ArgumentError with nil originating_system_audit' do
    lambda {
      @feeder_audit.originating_system_audit = nil
    }.should raise_error ArgumentError
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
open_ehr-0.9.4 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb
open_ehr-0.9.3 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb
open_ehr-0.9.2 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb
open_ehr-0.9.1 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb
open_ehr-0.9.0 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb
open_ehr-0.6.1 spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb