Skip to content

Instantly share code, notes, and snippets.

@bschonec
Created March 24, 2023 15:54
Show Gist options
  • Save bschonec/25e8ddcb1fcf5d6b8befdee9d16c01b3 to your computer and use it in GitHub Desktop.
Save bschonec/25e8ddcb1fcf5d6b8befdee9d16c01b3 to your computer and use it in GitHub Desktop.
{
comment => "Gitlab Server",
lane => "d",
prefix => "nfiv",
node_num => "01",
application => "gitlab"
}
@bschonec
Copy link
Author

describe 'test application fact' do
subject(:fact) { Facter.fact(:application) }

before(:each) do
# perform any action that should be run before every test
Facter.clear
end

let(:facts) { { fqdn: 'nfiv-gitlab-01d.example.com' } }

it 'uses the built-in facts to return the application' do
expect(Facter.fact(:application).value).to eq('gitlab') <- the custom fact returns a hash. How do I test for application['application'] ??
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment