Sha256: ceb5aa85718c1da06fbf3d162cb9c98cf0b3242b32ced5d46f731dda765f1bfd

Contents?: true

Size: 729 Bytes

Versions: 218

Compression:

Stored size: 729 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__),"..","lib")

require 'test/unit'
require 'rgen/metamodel_builder'
require 'rgen/fragment/model_fragment'

class ModelFragmentTest < Test::Unit::TestCase

module TestMetamodel
  extend RGen::MetamodelBuilder::ModuleExtension

  class SimpleClass < RGen::MetamodelBuilder::MMBase
    has_attr 'name', String
    contains_many 'subclass', SimpleClass, 'parent'
  end
end

def test_elements
  root = TestMetamodel::SimpleClass.new(:name => "parent",
    :subclass => [TestMetamodel::SimpleClass.new(:name => "child")])
  
  frag = RGen::Fragment::ModelFragment.new("location")
  frag.set_root_elements([root])

  assert_equal 2, frag.elements.size
end

end


Version data entries

218 entries across 218 versions & 3 rubygems

Version Path
puppet-4.10.12 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.12-x86-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.12-x64-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.12-universal-darwin lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.11 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.11-x86-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.11-x64-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.11-universal-darwin lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.10 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.10-x86-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.10-x64-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.10-universal-darwin lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.9 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.9-x86-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.9-x64-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.9-universal-darwin lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-retrospec-1.5.0 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.8 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.8-x86-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb
puppet-4.10.8-x64-mingw32 lib/puppet/vendor/rgen/test/model_fragment_test.rb