Skip to content

Commit cb7301a

Browse files
committed
Add pending tests for to_json_pretty with skip_undef enabled
1 parent 1723e8e commit cb7301a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/functions/to_json_pretty_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@
1414
it { is_expected.to run.with_params({ 'one' => '1', 'two' => nil }, true).and_return("{\n \"one\": \"1\"\n}\n") }
1515
it { is_expected.to run.with_params(['one', 'two', nil, 'three'], true).and_return("[\n \"one\",\n \"two\",\n \"three\"\n]\n") }
1616
it { is_expected.to run.with_params(['one', 'two', nil, 'three'], true, 'indent' => '@@@@').and_return("[\n@@@@\"one\",\n@@@@\"two\",\n@@@@\"three\"\n]\n") }
17+
18+
it {
19+
pending('Current implementation only elides nil values for arrays of depth=1')
20+
is_expected.to run.with_params([[nil], 'two', nil, 'three'], true).and_return("[\n [\n\n ],\n \"two\",\n \"three\"\n]\n")
21+
}
22+
23+
it {
24+
pending('Current implementation only elides nil values for hashes of depth=1')
25+
is_expected.to run.with_params({ 'omg' => { 'lol' => nil }, 'what' => nil }, true).and_return("{\n}\n")
26+
}
1727
end

0 commit comments

Comments
 (0)