Sha256: 1119793e968f79b0f7f5779e74ec29787599be7f697545357b5e852e816b2568

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

# $Id: test_pid_segment.rb 40 2007-06-30 01:29:19Z segfault $
$: << '../lib'
require 'test/unit'
require 'ruby-hl7'

class PidSegment < Test::Unit::TestCase
  def setup
    @base = "PID|||333||LastName^FirstName^MiddleInitial^SR^NickName||19760228|F||||||||||555. 55|012345678"
  end

  def test_admin_sex_limits
    pid = HL7::Message::Segment::PID.new
    assert_nothing_raised do
      vals = %w[F M O U A N] + [ nil ]
      vals.each do |x|
        pid.admin_sex = x
      end
      pid.admin_sex = ""
    end

    assert_raises( HL7::InvalidDataError ) do
      ["TEST", "A", 1, 2].each do |x|
        pid.admin_sex = x
      end
    end
        
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-hl7-0.2.50 test/test_pid_segment.rb
ruby-hl7-0.2.44 test/test_pid_segment.rb