From a11be21118506f09123644f477654afd20b0aa8a Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Fri, 6 Oct 2017 16:56:07 +0200 Subject: [PATCH] task(generate_manifest): fix test cleanup --- spec/tasks/generate_manifest/task_spec.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/spec/tasks/generate_manifest/task_spec.rb b/spec/tasks/generate_manifest/task_spec.rb index 626758542..0c8dd8b65 100644 --- a/spec/tasks/generate_manifest/task_spec.rb +++ b/spec/tasks/generate_manifest/task_spec.rb @@ -4,12 +4,10 @@ describe 'generate_manifest task' do - - after(:context) do - FileUtils.rm_rf @generated_files if File.exist? @generated_files - end - context 'when no template are detected' do + after(:context) do + FileUtils.rm_rf @generated_files + end before(:context) do @generated_files = Dir.mktmpdir @@ -52,6 +50,10 @@ 'SUFFIX' => '') end + after(:context) do + FileUtils.rm_rf @generated_files + end + it 'generates a file per valid template' do tpl_yml_files .map { |filename| File.basename(filename, '-tpl.yml') } .each do |base_filename|