File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 167167
168168 case result
169169 when Array , Hash
170- Puppet ::Util ::Json . dump ( result , :pretty => true )
170+ # JSON < 2.8.0 would pretty print empty arrays and hashes with newlines
171+ # Maintain that behavior for our users for now
172+ if result . is_a? ( Array ) && result . empty?
173+ "[\n \n ]"
174+ elsif result . is_a? ( Hash ) && result . empty?
175+ "{\n }"
176+ else
177+ Puppet ::Util ::Json . dump ( result , :pretty => true )
178+ end
171179 else # one of VALID_TYPES above
172180 result
173181 end
Original file line number Diff line number Diff line change 9191
9292 {
9393 "type_hash" => [ { 'a' => 2 } , "{\n \" a\" : 2\n }" ] ,
94+ "type_empty_hash" => [ { } , "{\n }" ] ,
9495 "type_array" => [ [ ] , "[\n \n ]" ] ,
9596 "type_string" => [ "str" , "str" ] ,
9697 "type_int" => [ 1 , "1" ] ,
Original file line number Diff line number Diff line change 7777
7878 it "raises if given an invalid URI" do
7979 resource [ :source ] = 'h;ttp://rubygems.com'
80- expect { provider . install } . to raise_error ( Puppet ::Error , /Invalid source '': bad URI\( is not URI\? \) / )
80+ expect { provider . install } . to raise_error ( Puppet ::Error , /Invalid source '': bad URI \( is not URI\? \) / )
8181 end
8282 end
8383 end
You can’t perform that action at this time.
0 commit comments