Skip to content

Commit

Permalink
Add test for augeas.version fact
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 14, 2024
1 parent 56569bd commit 396ee55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ inherit_from: .rubocop_todo.yml

inherit_gem:
voxpupuli-rubocop: rubocop.yml

Style/IfUnlessModifier:
Enabled: false
8 changes: 8 additions & 0 deletions spec/facts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@
expect(content['facterversion']).to have_facter_version(facter_dir_path, filepath)
end

# when facts are generated with distro facter or rubygems facter the augeas bindings might be missing
# we need to ensure they exist
it 'contains the augeas.version fact' do
if Gem::Version.new(content['facterversion']) >= Gem::Version.new('3.11.0')
expect(content['augeas']['version']).to not_be_nil.and not_be_empty
end
end

it 'contains newer networking facts hash' do
if Gem::Version.new(content['facterversion']) >= Gem::Version.new('3.0.0')
expect(content['networking']['ip']).to not_be_nil.and not_be_empty
Expand Down

0 comments on commit 396ee55

Please sign in to comment.