Skip to content

Commit

Permalink
Ignore more installed versions of python during tests
Browse files Browse the repository at this point in the history
The unit tests for python_dir fact were giving a false failure

```
1) python_dir is empty string if python not installed
   Failure/Error: expect(Facter.fact(:python_dir).value).to eq('')
     expected: ""
          got: "/usr/lib/python2.7/site-packages"
     (compared using ==)
```

If they were executed on a system where `/usr/libexec/platform-python`
was present - not the case (presumably) for Travis CI.
  • Loading branch information
traylenator committed Mar 20, 2020
1 parent 26e4cb2 commit 4a4fd52
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/unit/python_dir_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

it 'is empty string if python not installed' do
Facter::Util::Resolution.stubs(:which).with('python').returns(nil)
Facter::Util::Resolution.stubs(:which).with('python2').returns(nil)
Facter::Util::Resolution.stubs(:which).with('python3').returns(nil)
Facter::Util::Resolution.stubs(:which).with('python3').returns(nil)
expect(Facter.fact(:python_dir).value).to eq('')
end
Expand Down

0 comments on commit 4a4fd52

Please sign in to comment.