diff --git a/lib/octocatalog-diff/catalog-diff/display/text.rb b/lib/octocatalog-diff/catalog-diff/display/text.rb index 17e4aadd..c4cc13c5 100644 --- a/lib/octocatalog-diff/catalog-diff/display/text.rb +++ b/lib/octocatalog-diff/catalog-diff/display/text.rb @@ -367,12 +367,13 @@ def self.addition_only_no_truncation(depth, hash) # Single line strings hash.keys.sort.map do |key| - next if hash[key] =~ /\n/ + next if hash[key].kind_of?(String) && hash[key] =~ /\n/ result << left_pad(2 * depth + 4, [key.inspect, ': ', hash[key].inspect].join('')).green end # Multi-line strings hash.keys.sort.map do |key| + next if !hash[key].kind_of?(String) next if hash[key] !~ /\n/ result << left_pad(2 * depth + 4, [key.inspect, ': >>>'].join('')).green result.concat hash[key].split(/\n/).map(&:green) diff --git a/spec/octocatalog-diff/tests/catalog-diff/display/text_spec.rb b/spec/octocatalog-diff/tests/catalog-diff/display/text_spec.rb index f05f491c..9d9069d4 100644 --- a/spec/octocatalog-diff/tests/catalog-diff/display/text_spec.rb +++ b/spec/octocatalog-diff/tests/catalog-diff/display/text_spec.rb @@ -254,7 +254,8 @@ 'mode' => '0644', 'content' => 'x' * 150, 'owner' => 'root', - 'group' => 'wheel' + 'group' => 'wheel', + 'force' => true, } } ]