Skip to content

Commit

Permalink
(maint) - Update tests to sym key
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Jul 19, 2023
1 parent dce9e87 commit 3ca517d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/rspec_puppet_facts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -901,24 +901,24 @@

it 'adds a simple fact and value' do
add_custom_fact 'root_home', '/root'
expect(subject['redhat-7-x86_64']['root_home']).to eq '/root'
expect(subject['redhat-7-x86_64'][:root_home]).to eq '/root'
end

it 'confines a fact to a particular operating system' do
add_custom_fact 'root_home', '/root', :confine => 'redhat-7-x86_64'
expect(subject['redhat-7-x86_64']['root_home']).to eq '/root'
expect(subject['redhat-6-x86_64']['root_home']).to be_nil
expect(subject['redhat-7-x86_64'][:root_home]).to eq '/root'
expect(subject['redhat-6-x86_64'][:root_home]).to be_nil
end

it 'excludes a fact from a particular operating system' do
add_custom_fact 'root_home', '/root', :exclude => 'redhat-7-x86_64'
expect(subject['redhat-7-x86_64']['root_home']).to be_nil
expect(subject['redhat-6-x86_64']['root_home']).to eq '/root'
expect(subject['redhat-7-x86_64'][:root_home]).to be_nil
expect(subject['redhat-6-x86_64'][:root_home]).to eq '/root'
end

it 'takes a proc as a value' do
add_custom_fact 'root_home', ->(_os, _facts) { '/root' }
expect(subject['redhat-7-x86_64']['root_home']).to eq '/root'
expect(subject['redhat-7-x86_64'][:root_home]).to eq '/root'
end
end

Expand Down

0 comments on commit 3ca517d

Please sign in to comment.