lib/rspec/terraform/helpers/actions/remove.rb in rspec-terraform-0.1.0.pre.47 vs lib/rspec/terraform/helpers/actions/remove.rb in rspec-terraform-0.1.0.pre.48
- old
+ new
@@ -6,12 +6,31 @@
module Terraform
module Helpers
module Actions
module Remove
def remove(parameters, file)
+ configuration_directory = parameters[:configuration_directory]
+
+ log_remove_starting(configuration_directory, file)
+
FileUtils.rm_f(
- File.join(parameters[:configuration_directory], file)
+ File.join(configuration_directory, file)
)
+
+ log_remove_complete
+ end
+
+ private
+
+ def log_remove_starting(configuration_directory, file)
+ logger&.info(
+ "Removing file: '#{file}' in configuration directory: " \
+ "'#{configuration_directory}'..."
+ )
+ end
+
+ def log_remove_complete
+ logger&.info('Remove complete.')
end
end
end
end
end