HomePhorge

Properly determine file deletion in puppet/unit/util_spec.rb
a2ced0f6aaebUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Properly determine file deletion in puppet/unit/util_spec.rb

This test had previously been checking that the path attribute of the
Tempfile used for stdout was nil, in order to determine whether or not
the file had been deleted. However, on Ruby 1.8.5, a Tempfile's data is
not cleared when the file is closed and deleted. Thus, its path wasn't
actually nil and it was failing, even though the file had properly been
deleted.

Now, we just check whether or not the file exists, which will always
directly correspond to whether or not the file has been deleted.

Reviewed-By: Matt Robinson <matt@puppetlabs.com>

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU2bd9b7918599: Merge pull request #54 from nicklewis/ticket/2.7.x/8410
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPUa2ced0f6aaeb: Properly determine file deletion in puppet/unit/util_spec.rb (authored by Nick Lewis <nick@puppetlabs.com>).Aug 25 2011, 2:56 AM