Skip to content

Commit bba31cc

Browse files
committed
(PUP-11764) Convert missing_checksums_json
1 parent a263608 commit bba31cc

File tree

2 files changed

+29
-42
lines changed

2 files changed

+29
-42
lines changed

acceptance/tests/modules/changes/missing_checksums_json.rb

Lines changed: 0 additions & 42 deletions
This file was deleted.

spec/integration/application/module_spec.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,34 @@
119119
}.to exit_with(1)
120120
.and output(pattern).to_stderr
121121
end
122+
123+
it 'reports when checksums are missing from metadata.json' do
124+
tmp = tmpdir('module_invalid_checksums')
125+
FileUtils.cp_r(File.join(my_fixture_dir, 'environments'), tmp)
126+
127+
# overwrite checksums in metadata.json
128+
nginx_dir = File.join(tmp, 'environments', 'direnv', 'modules', 'nginx')
129+
File.write(File.join(nginx_dir, 'metadata.json'), <<~END)
130+
{
131+
"name": "pmtacceptance/nginx",
132+
"version": "0.0.1"
133+
}
134+
END
135+
136+
Puppet.initialize_settings(['-E', 'direnv'])
137+
Puppet[:color] = false
138+
Puppet[:environmentpath] = File.join(tmp, 'environments')
139+
140+
pattern = Regexp.new([
141+
%Q{.*Error: No file containing checksums found.*},
142+
%Q{.*Error: Try 'puppet help module changes' for usage.*},
143+
].join("\n"), Regexp::MULTILINE)
144+
145+
expect {
146+
app.command_line.args = ['changes', nginx_dir]
147+
app.run
148+
}.to exit_with(1)
149+
.and output(pattern).to_stderr
150+
end
122151
end
123152
end

0 commit comments

Comments
 (0)