HomePhorge

(maint) Fix face specs to not pollute global state.
275ac959db06Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(maint) Fix face specs to not pollute global state.

The face_collection_base spec attempts to restore global state stored in
Puppet::Interface::FaceCollection so that it doesn't interfere with
other specs that may use faces.

It fails to clear any files required by the autoloader, but clears the
@faces member. The result is that if a face is referenced again from
another spec, it doesn't get defined and added to @faces and cannot be
found.

The fix is to clear the state before and after each example.

The problem can be observed with the following:
rspec spec/unit/interface/face_collection_spec.rb spec/unit/application/face_base_spec.rb

Additionally, the indirection_base spec registers a face but does not remove the face
after the examples have fun. The fix is to remove the face from the FaceCollection after
all examples.

Details

Provenance
Peter Huene <peter.huene@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUa71ab022f7fe: (PUP-1174) Use Puppet::Util.absolute_path? to validate purge_ssh_keys
Branches
Unknown
Tags
Unknown

Event Timeline

Peter Huene <peter.huene@puppetlabs.com> committed rPU275ac959db06: (maint) Fix face specs to not pollute global state. (authored by Peter Huene <peter.huene@puppetlabs.com>).Mar 12 2014, 11:49 PM