Sha256: e24adb41f6affbc77e236577f87bd825b185691cb6e97e95ac9a5237372f9737

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

=begin
* Description: Test Mdcodes methods
* Author: Josh Bradley
* Date: 2014-11-07
* License: Public Domain
=end

require 'minitest/autorun'
require File.join(File.dirname(__FILE__),'..','lib', 'adiwg-mdcodes.rb')

class TestMdcodes < Minitest::Test
  def test_parseYaml
    @errors = Array.new

    FileList[ADIWG::Mdcodes.getYamlPath + '**/*.yml'].each do |fname|
      begin YAML.load_file(fname)
      rescue Exception
        @errors << "Could not parse YAML: #{fname}"
      end
    end
    assert(@errors.empty?, @errors.join("\n"))
  end

  def test_yamlResourceDir
    yamlDir = ADIWG::Mdcodes.getYamlPath
    assert(Dir.exist?(yamlDir), 'Did not find resource Directory.')
  end

  def test_getAllCodeistsDetail
    assert_instance_of(Hash,ADIWG::Mdcodes.getAllCodeistsDetail)
  end

  def test_getCodelistDetail
    yaml = ADIWG::Mdcodes.getAllCodeistsDetail
    key = yaml.keys[0]
    assert_instance_of(Hash,ADIWG::Mdcodes.getCodelistDetail(key))
  end

  def test_getAllStaticCodelists
    assert_instance_of(Hash,ADIWG::Mdcodes.getAllStaticCodelists)
  end

  def test_getStaticCodelist
    yaml = ADIWG::Mdcodes.getAllStaticCodelists
    key = yaml.keys[0]
    assert_instance_of(Hash,ADIWG::Mdcodes.getStaticCodelist(key))
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adiwg-mdcodes-2.1.3.pre.beta2 test/tc_mdcodes.rb
adiwg-mdcodes-2.1.2.pre.beta1 test/tc_mdcodes.rb
adiwg-mdcodes-2.1.2.pre.beta test/tc_mdcodes.rb
adiwg-mdcodes-2.0.0 test/tc_mdcodes.rb