Skip to content

Commit

Permalink
Merge pull request #2733 from joshcooper/write_to_file
Browse files Browse the repository at this point in the history
(FACT-3205) Ignore ENOENT when cleaning up temporary test files
  • Loading branch information
cthorn42 authored Jun 24, 2024
2 parents 3d23636 + 73fa004 commit 06c37a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
39 changes: 18 additions & 21 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ Naming/VariableNumber:
- 'lib/facter/resolvers/windows/ffi/networking_ffi.rb'
- 'lib/facter/util/facts/windows_release_finder.rb'

RSpec/MultipleMemoizedHelpers:
Enabled: false

RSpec/StubbedMock:
Enabled: false

Style/IfUnlessModifier:
Enabled: false

# $stdout is preferred because it refers to the *current* stdout stream, while
# STDOUT refers to the original stream. However, we can't just switch to using
# $stdout, because it may have been assigned to a different object than STDOUT,
# such as a IO to a file.
Style/GlobalStdStream:
Exclude:
- 'lib/facter.rb'
- 'lib/facter/framework/cli/cli_launcher.rb'
- 'lib/facter/framework/logging/logger.rb'
- 'spec/framework/core/fact/internal/internal_fact_manager_spec.rb'
- 'spec/framework/logging/logger_spec.rb'

RSpec/DescribedClass:
EnforcedStyle: explicit

Expand All @@ -94,6 +73,9 @@ RSpec/MultipleMemoizedHelpers:
RSpec/NestedGroups:
Enabled: 6

RSpec/StubbedMock:
Enabled: false

RSpec/SubjectStub:
Exclude:
- 'spec/custom_facts/core/aggregate_spec.rb'
Expand All @@ -113,3 +95,18 @@ RSpec/VerifiedDoubles:
- 'spec/facter/resolvers/windows/*'
- 'spec/facter/util/windows/network_utils_spec.rb'
- 'spec/facter/util/windows/win32ole_spec.rb'

# $stdout is preferred because it refers to the *current* stdout stream, while
# STDOUT refers to the original stream. However, we can't just switch to using
# $stdout, because it may have been assigned to a different object than STDOUT,
# such as a IO to a file.
Style/GlobalStdStream:
Exclude:
- 'lib/facter.rb'
- 'lib/facter/framework/cli/cli_launcher.rb'
- 'lib/facter/framework/logging/logger.rb'
- 'spec/framework/core/fact/internal/internal_fact_manager_spec.rb'
- 'spec/framework/logging/logger_spec.rb'

Style/IfUnlessModifier:
Enabled: false
2 changes: 1 addition & 1 deletion spec/custom_facts/puppetlabs_spec/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.cleanup
begin
FileUtils.rm_r path, secure: true
rescue Errno::ENOENT
puts 'failed to recursively delete files'
# nothing to do
end
end
end
Expand Down

0 comments on commit 06c37a2

Please sign in to comment.