Skip to content
Permalink
Browse files

(bugfix) Only test hyphenated classnames with Puppet 3

Hyphens are not allowed in classnames in Puppet 4, so we should only
test that they work in Puppet 3. This commit makes this so.
  • Loading branch information...
ajroetker authored and kbarber committed Jan 14, 2015
1 parent caea3df commit 68bf176e0bd4d51c1ba36909f4966671379a775e
Showing with 12 additions and 10 deletions.
  1. +12 −10 puppet/spec/unit/indirector/catalog/puppetdb_spec.rb
@@ -446,8 +446,9 @@ def catalog_data_hash
result['edges'].should include(edge)
end

it "should add edges which refer to collected virtual resources with hyphens in the classname" do
Puppet[:code] = <<-MANIFEST
if Puppet::Util::Puppetdb.puppet3compat?
it "should add edges which refer to collected virtual resources with hyphens in the classname" do
Puppet[:code] = <<-MANIFEST
define foo-bar- (){}
@foo-bar- { 'baz': }
@@ -456,16 +457,17 @@ def catalog_data_hash
}
Foo-bar- <| |>
MANIFEST
MANIFEST

result = subject.munge_catalog(catalog)
other_edge = {
'source' => {'type' => 'Notify', 'title' => 'source'},
'target' => {'type' => 'Foo-bar-', 'title' => 'baz'},
'relationship' => 'before'
}
result = subject.munge_catalog(catalog)
other_edge = {
'source' => {'type' => 'Notify', 'title' => 'source'},
'target' => {'type' => 'Foo-bar-', 'title' => 'baz'},
'relationship' => 'before'
}

result['edges'].should include(other_edge)
result['edges'].should include(other_edge)
end
end

it "should add edges defined on collected virtual resources" do

0 comments on commit 68bf176

Please sign in to comment.
You can’t perform that action at this time.