Skip to content

Commit

Permalink
spec: adapt tests to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ffrank committed Feb 27, 2024
1 parent f4eb987 commit 6272014
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions spec/integration/type/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
Puppet.stubs(:err).with(regexp_matches(/ignore source permissions/))

Puppet.expects(:err).with(regexp_matches(/puppet fileserver URL/))
Puppet.expects(:err).with(regexp_matches(/cannot be translated natively/))

graph = PuppetX::CatalogTranslation.to_mgmt(catalog)
expect(graph['resources']).to_not include 'file'
Expand All @@ -45,7 +44,6 @@
Puppet.stubs(:err).with(regexp_matches(/ignore source permissions/))

Puppet.expects(:err).with(regexp_matches(/multiple sources/))
Puppet.expects(:err).with(regexp_matches(/cannot be translated natively/))

graph = PuppetX::CatalogTranslation.to_mgmt(catalog)
expect(graph['resources']).to_not include 'file'
Expand Down
3 changes: 1 addition & 2 deletions spec/integration/type/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

it "fails on unsupported ensure values" do
%w{1.3.1-5 latest 10bpo81 held}.each do |ensure_value|
Puppet.expects(:err).with(regexp_matches(/cannot be translated/)).twice
Puppet.expects(:err).with(regexp_matches(/cannot be translated/))
catalog = resource_catalog("Package { provider => 'apt' } package { 'cowsay': ensure => '#{ensure_value}' }")
graph = PuppetX::CatalogTranslation.to_mgmt(catalog)

# become 'exec puppet yamlresource' through the workaround
expect(graph['resources']).to_not include('pkg')
expect(graph['resources']).to include('pippet')
end
Expand Down
1 change: 0 additions & 1 deletion spec/unit/catalog_translation/type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

it "emits an error" do
Puppet.expects(:err).with(regexp_matches /cannot translate.*hasrestart/)
Puppet.expects(:err).with(regexp_matches /cannot be translated natively/)
translator.translate!(resource)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/catalog_translation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
it "does not touch the catalog indirection terminus" do
catalog_face.expects(:find)
catalog_face.expects(:set_terminus).never
subject.get_catalog
expect { subject.get_catalog }.to raise_error(Puppet::Error)
end
end

Expand Down

0 comments on commit 6272014

Please sign in to comment.