-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(FACT-2826) Added Facter.flush #2140
Conversation
CLA signed by all contributors. |
82a9be4
to
ea66c87
Compare
Jenkins please test this on all |
debfc2c
to
5d225e6
Compare
acceptance/tests/facter_flush.rb
Outdated
|
||
Facter.flush | ||
|
||
puts "Fact1: \#\{Facter.value(:fact)\}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are asking for a fact that doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, missed that. Thanks
@@ -403,6 +403,20 @@ def mock_collection(method, os_name = nil, error = nil) | |||
end | |||
end | |||
|
|||
describe '#flush' do | |||
it 'sends call to LegacyFacter' do | |||
allow(LegacyFacter).to receive(:flush) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit test should be separated according to the AAA pattern (Arrange, Act, Assert).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks!
5d225e6
to
395a0ad
Compare
Facter flush sets the resolved value to nil without restarting the resolution. Besides that flushing can be hooked using on_flush in custom facts.