Skip to content

Commit 198eec9

Browse files
committed
(PUP-11846) Add test for Deferred(Sensitive) file content
1 parent b92e4d3 commit 198eec9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/integration/application/apply_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,5 +755,19 @@ def bogus()
755755
.and output(/Notify\[runs before file\]/).to_stdout
756756
.and output(/Validation of File.* failed: You cannot specify more than one of content, source, target/).to_stderr
757757
end
758+
759+
it "applies deferred sensitive file content" do
760+
manifest = <<~END
761+
file { '#{deferred_file}':
762+
ensure => file,
763+
content => Deferred('new', [Sensitive, "hello\n"])
764+
}
765+
END
766+
apply.command_line.args = ['-e', manifest]
767+
expect {
768+
apply.run
769+
}.to exit_with(0)
770+
.and output(/ensure: changed \[redacted\] to \[redacted\]/).to_stdout
771+
end
758772
end
759773
end

0 commit comments

Comments
 (0)