diff --git a/spec/support/file_helper.rb b/spec/support/file_helper.rb index 1e859eb0fd..251788f460 100644 --- a/spec/support/file_helper.rb +++ b/spec/support/file_helper.rb @@ -7,7 +7,7 @@ def create_file(file_path, content) file_path = File.expand_path(file_path) dir_path = File.dirname(file_path) - FileUtils.makedirs dir_path unless File.exist?(dir_path) + FileUtils.makedirs dir_path File.open(file_path, 'w') do |file| case content diff --git a/tasks/changelog.rb b/tasks/changelog.rb index 3e7b336b41..5740cdb230 100644 --- a/tasks/changelog.rb +++ b/tasks/changelog.rb @@ -30,7 +30,7 @@ def initialize(type:, body: last_commit_title, ref_type: nil, ref_id: nil, user: end def write - Dir.mkdir(ENTRIES_PATH) unless Dir.exist?(ENTRIES_PATH) + Dir.mkdir(ENTRIES_PATH) File.write(path, content) path end