Sha256: 8dfb38ce6e47c00353707380244c0915e81209f14b7706643254d7fb21d7ba2e

Contents?: true

Size: 1.55 KB

Versions: 21

Compression:

Stored size: 1.55 KB

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/parser_spec_helper'
include OpenEHR::Parser

describe ADLParser do
  context 'Language no accrediition' do
    before(:all) do
      target_adl_file = 'adl-test-entry.archetype_language_no_accreditation.test.adl'
      ap = ADLParser.new(ADL14DIR + target_adl_file)
      archetype = ap.parse
      @translations = archetype.translations
    end

    it 'exists' do
      @translations.should_not be_nil
    end

    context 'German translation' do
      before(:all) do
        @de = @translations['de']
      end

      it 'exists' do
        @de.should_not be_nil
      end

      context 'author' do
        before(:all) do
          @author = @de.author
        end

        it 'exists' do
          @author.should_not be_nil
        end

        it 'name is Harry Potter' do
          @author['name'].should == 'Harry Potter'
        end

        it 'email is harry@something.somewhere.co.uk' do
          @author['email'].should == 'harry@something.somewhere.co.uk'
        end
      end

      context 'accreditation' do
        it 'not exist' do
          @de.accreditation.should be_nil
        end
      end

      context 'other details' do
        before(:all) do
          @other_details = @de.other_details
        end

        it 'review 1 is Ron Weasley' do
          @other_details['review 1'].should == 'Ron Weasley'
        end

        it 'review 2 is Rubeus Hagrid' do
          @other_details['review 2'].should == 'Rubeus Hagrid'
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
open_ehr-0.9.4 spec/lib/open_ehr/parser/adl_language_no_accreditation_spec.rb