spec/integration/recipes/default.rb in itamae-1.9.3 vs spec/integration/recipes/default.rb in itamae-1.9.4
- old
+ new
@@ -362,10 +362,14 @@
action :nothing
end
#####
+execute 'echo -n 1 > /tmp/file_edit_notifies' do
+ action :nothing
+end
+
file '/tmp/file_edit_sample' do
content 'Hello, world'
owner 'itamae'
group 'itamae'
mode '444'
@@ -380,11 +384,21 @@
content.gsub!('world', 'Itamae')
end
notifies :run, "execute[echo -n 1 > /tmp/file_edit_notifies]"
end
-execute 'echo -n 1 > /tmp/file_edit_notifies' do
- action :nothing
+file '/tmp/file_edit_keeping_mode_owner' do
+ content 'Hello, world'
+ owner 'itamae'
+ group 'itamae'
+ mode '444'
+end
+
+file '/tmp/file_edit_keeping_mode_owner' do
+ action :edit
+ block do |content|
+ content.gsub!('world', 'Itamae')
+ end
end
###
unless run_command("echo -n Hello").stdout == "Hello"