Skip to content

Commit b86a612

Browse files
committed
(PUP-11604) Add test for missing dependencies
1 parent dd0ce50 commit b86a612

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

spec/unit/face/module/list_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,30 @@ def console_output(options={})
227227
console_output(:tree => true)
228228
end
229229
end
230+
231+
describe "when rendering as json" do
232+
let(:face) { Puppet::Face[:module, :current] }
233+
let(:action) { face.get_action(:list) }
234+
235+
it "should warn about missing dependencies" do
236+
PuppetSpec::Modules.create('depender', @modpath1, :metadata => {
237+
:version => '1.0.0',
238+
:dependencies => [{
239+
"version_requirement" => ">= 0.0.5",
240+
"name" => "puppetlabs/dependable"
241+
}]
242+
})
243+
244+
result = face.list
245+
expect(result.dig(:unmet_dependencies, :missing)).to include(
246+
"puppetlabs/dependable" => {
247+
errors: ["'puppetlabs-depender' (v1.0.0) requires 'puppetlabs-dependable' (>= 0.0.5)"],
248+
parent: {
249+
name: "puppetlabs/depender", :version=>"v1.0.0"
250+
},
251+
version: nil
252+
}
253+
)
254+
end
255+
end
230256
end

0 commit comments

Comments
 (0)