Sha256: e81dcd2c9491efd6503c04cff9a0a8c71528b7d5aebe93846d94d6aeda638787

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

$d = File.expand_path(File.dirname(__FILE__))
require "test/unit"
require File.join($d,'..','lib','mof')

class TestAssociationQualifiers < Test::Unit::TestCase

  def setup
    @moffiles, @options = MOF::Parser.argv_handler "test_association_qualifier", ["association_qualifier.mof"]
    @options[:style] ||= :cim
    @options[:includes] ||= [ $d, File.join($d,"mof")]

    @parser = MOF::Parser.new @options
  end
  
  def test_parse
    result = @parser.parse @moffiles
    assert result
    # parsed one file
    assert_equal 1, result.size

    name,res = result.shift
    assert !res.qualifiers.empty?
    # parsed one qualifier
    assert_equal 1, res.qualifiers.size
    q = res.qualifiers.shift
    assert q.is_a? CIM::QualifierDeclaration
    assert q.type == :boolean
    assert q.default == false
    # has one qualifier scopes
    assert_equal 1, q.scopes.size
    assert q.scopes.include? :association
    # has two qualifier flavors
    assert_equal 2, q.flavors.size
    assert q.flavors.include? :disableoverride
    assert q.flavors.include? :tosubclass
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mof-1.2.5 test/test_association_qualifier.rb
mof-1.2.4 test/test_association_qualifier.rb
mof-1.2.2 test/test_association_qualifier.rb
mof-1.2.0 test/test_association_qualifier.rb