Skip to content

Commit

Permalink
Merge pull request #668 from m3t30r/master
Browse files Browse the repository at this point in the history
Set collectd_version fact to nil rather than empty string when not present
  • Loading branch information
wyardley committed Sep 15, 2017
2 parents 2c85898 + 200fd79 commit 0ce348d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/facter/collectd_version.rb
Expand Up @@ -11,8 +11,6 @@
if Facter::Util::Resolution.which('collectd')
collectd_help = Facter::Util::Resolution.exec('collectd -h')
%r{^collectd ([\w\.]+), http://collectd\.org/}.match(collectd_help)[1]
else
''
end
end
end
4 changes: 2 additions & 2 deletions spec/unit/collectd_real_version_spec.rb
Expand Up @@ -18,8 +18,8 @@
expect(Facter.fact(:collectd_version).value).to eq('5.1.0.git')
end

it 'is empty string if collectd not installed' do
it 'is not defined if collectd not installed' do
Facter::Util::Resolution.stubs(:which).with('collectd').returns(nil)
expect(Facter.fact(:collectd_version).value).to eq('')
expect(Facter.fact(:collectd_version).value).to be_nil
end
end

0 comments on commit 0ce348d

Please sign in to comment.