Skip to content

Commit bcf317c

Browse files
committed
(PUP-11764) Convert module_with_modified_file
1 parent 0bc7dcb commit bcf317c

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

acceptance/tests/modules/changes/module_with_modified_file.rb

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

spec/integration/application/module_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,29 @@
172172
}.to exit_with(1)
173173
.and output(pattern).to_stderr
174174
end
175+
176+
it 'reports when a file is modified' do
177+
tmp = tmpdir('module_modified_metadata')
178+
FileUtils.cp_r(File.join(my_fixture_dir, 'environments'), tmp)
179+
180+
# overwrite README so checksum doesn't match
181+
nginx_dir = File.join(tmp, 'environments', 'direnv', 'modules', 'nginx')
182+
File.write(File.join(nginx_dir, 'README'), '')
183+
184+
Puppet.initialize_settings(['-E', 'direnv'])
185+
Puppet[:color] = false
186+
Puppet[:environmentpath] = File.join(tmp, 'environments')
187+
188+
pattern = Regexp.new([
189+
%Q{.*Warning: 1 files modified.*},
190+
].join("\n"), Regexp::MULTILINE)
191+
192+
expect {
193+
app.command_line.args = ['changes', nginx_dir]
194+
app.run
195+
}.to exit_with(0)
196+
.and output(%r{README}).to_stdout
197+
.and output(pattern).to_stderr
198+
end
175199
end
176200
end

0 commit comments

Comments
 (0)