Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Fix face_collection_spec to properly restore global state. #2422

Closed
wants to merge 1 commit into from

Conversation

peterhuene
Copy link
Contributor

The 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

The 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
@puppetcla
Copy link

CLA signed by all contributors.

@peterhuene peterhuene deleted the maint/spec_fix branch March 12, 2014 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants