Sha256: a795e05ac3463d80dcf17259a8982770ab60de45efc6e61610984decc12db6e4

Contents?: true

Size: 1.9 KB

Versions: 5

Compression:

Stored size: 1.9 KB

Contents

#
#  Copyright (C) 2014-2017  Enrico Rivarola
#
#  This file is part of DcmDict gem (dcm_dict).
#
#  DcmDict is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  DcmDict is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with DcmDict.  If not, see <http://www.gnu.org/licenses/>.
#
#  This software has neither been tested nor approved for clinical use
#  or for incorporation in a medical device.
#  It is the redistributor's or user's responsibility to comply with any
#  applicable local, state, national or international regulations.
#
require 'spec_helper'

describe DcmDict::Dictionary::UidRecord do
  [
    { uid_value: '1.2.840.10008.1.2',
      uid_name: "Implicit VR Little Endian: Default Transfer Syntax for DICOM",
      uid_type: :transfer_syntax }
  ].each do |data|
    it "Handle Data Element Data correctly" do
      ur = DcmDict::Dictionary::UidRecord.new(data.dup)
      expect(ur.uid_value).to eq(data[:uid_value])
      expect(ur.uid).to eq(data[:uid_value])
      expect(ur.uid_name).to eq(data[:uid_name])
      expect(ur.uid_type).to eq(data[:uid_type])
    end


    include_examples "Record handle methods correctly",
                     DcmDict::Dictionary::UidRecord.new(data),
                     data

    it "data should be not modifiable" do
      uid = DcmDict::Dictionary::UidRecord.new(data.dup)
      old_value = uid.uid_value.dup
      expect{uid.uid_value << 'aaa'}.to raise_error(RuntimeError)
      expect(uid.uid_value).to eq(old_value)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dcm_dict-0.16.0 spec/dcm_dict/dictionary/uid_record_spec.rb
dcm_dict-0.15.0 spec/dcm_dict/dictionary/uid_record_spec.rb
dcm_dict-0.14.0 spec/dcm_dict/dictionary/uid_record_spec.rb
dcm_dict-0.13.0 spec/dcm_dict/dictionary/uid_record_spec.rb
dcm_dict-0.12.0 spec/dcm_dict/dictionary/uid_record_spec.rb