Skip to content

Commit eb24709

Browse files
committed
(PUP-11764) Convert module_with_removed_file
1 parent bcf317c commit eb24709

File tree

2 files changed

+25
-30
lines changed

2 files changed

+25
-30
lines changed

acceptance/tests/modules/changes/module_with_removed_file.rb

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

spec/integration/application/module_spec.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,30 @@
196196
.and output(%r{README}).to_stdout
197197
.and output(pattern).to_stderr
198198
end
199+
200+
it 'reports when a file is missing' do
201+
tmp = tmpdir('module_missing_file')
202+
FileUtils.cp_r(File.join(my_fixture_dir, 'environments'), tmp)
203+
204+
# delete README so checksum doesn't match
205+
nginx_dir = File.join(tmp, 'environments', 'direnv', 'modules', 'nginx')
206+
File.unlink(File.join(nginx_dir, 'README'))
207+
208+
Puppet.initialize_settings(['-E', 'direnv'])
209+
Puppet[:color] = false
210+
Puppet[:environmentpath] = File.join(tmp, 'environments')
211+
212+
# odd that it says modified
213+
pattern = Regexp.new([
214+
%Q{.*Warning: 1 files modified.*},
215+
].join("\n"), Regexp::MULTILINE)
216+
217+
expect {
218+
app.command_line.args = ['changes', nginx_dir]
219+
app.run
220+
}.to exit_with(0)
221+
.and output(%r{README}).to_stdout
222+
.and output(pattern).to_stderr
223+
end
199224
end
200225
end

0 commit comments

Comments
 (0)