HomePhorge

(maint) Don't try to set expectations on $CHILD_STATUS
17491a7e107fUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(maint) Don't try to set expectations on $CHILD_STATUS

Previously, executing bundle exec rspec spec/unit/util/execution_spec.rb
would fail on windows with an rspec error:

unexpected invocation: nil.==(/error message/)

The issue first appears in commit f41800a. I believe because before
f41800a, facter would evaluate the certname fact, executing hostname.exe
prior to executing the rspec example. As a result $CHILD_STATUS was never
nil when the test executed.

But starting in f41800a, $CHILD_STATUS may be nil as can be seen by the
rspec output:

expected exactly once, invoked once: nil.==(0)

Since the object we are trying to set an expectation on is global and
sometimes doesn't exist, this commit creates a private method for stubbing
and setting expectations on the $CHILD_STATUS.exitstatus

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUb119f66d6b7b: Merge pull request #2847 from hlindberg/PUP-2902_collect-class-is-error
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU17491a7e107f: (maint) Don't try to set expectations on $CHILD_STATUS (authored by Josh Cooper <josh@puppetlabs.com>).Jul 8 2014, 7:33 AM