Skip to content

Commit

Permalink
rubocop: Fix Layout/TrailingWhitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 10, 2022
1 parent 3f675c1 commit 1e3d71e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-06-10 13:03:28 UTC using RuboCop version 1.22.3.
# on 2022-06-10 13:03:56 UTC using RuboCop version 1.22.3.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'spec/unit/puppet/catalog_diff/comparer_spec.rb'

# Offense count: 21
# Cop supports --auto-correct.
Lint/AmbiguousOperatorPrecedence:
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/puppet/catalog_diff/comparer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@
diffs = compare_resources(res1, res2, show_resource_diff: true)
expect(diffs[:string_diffs]['file.foo'][3]).to eq("-\t content => \"foo content\"")
end

it 'returns string_diffs with show_resource_diff with content encoded in ISO8859-1 (latin1)' do
# Without this the unit test fails when running on LC_ALL=C but works with LC_ALL=en_US.UTF-8
# With this it works on both.
Encoding.default_internal = 'UTF-8'
Encoding.default_external = 'UTF-8' # Needed because diff uses tempfile.

latin1_string = [246].pack('C*').force_encoding('UTF-8')
res1[0][:parameters][:content] = latin1_string
res1[0][:parameters][:content] = latin1_string
expect { compare_resources(res1, res2, show_resource_diff: true) }.not_to raise_error
diffs = compare_resources(res1, res2, show_resource_diff: true)

ruby_default_replacement_string_for_invalid_characters = '�'
expect(diffs[:string_diffs]['file.foo'][3]).to \
eq("-\t content => \"" + ruby_default_replacement_string_for_invalid_characters + '"')
Expand Down

0 comments on commit 1e3d71e

Please sign in to comment.