Permalink
Browse files

JSON+comments: WIP

This commit breaks tests. It is intended to show that not all engines
support the JSON+Comments spec.

cf intridea#38
  • Loading branch information...
1 parent 3fc18d8 commit 8d233365e46e594d9e750d36a9854d490fead118 James A. Rosen committed Mar 21, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 spec/engine_shared_example.rb
View
19 spec/engine_shared_example.rb
@@ -111,5 +111,24 @@
MultiJson.decode(example, :symbolize_keys => true).should == expected
end
end
+
+ it 'strips //comments' do
+ [
+ [
+ %Q[{\n "abc":"def"// the abc\n}],
+ { 'abc' => 'def' }
+ ],
+ [
+ %Q{[\n "foo", // foo\n "bar" //bar\n]},
+ [ 'foo', 'bar' ]
+ ],
+ [
+ %Q[// a comment\n{"not a comment": "//not a comment"}],
+ { 'not a comment' => '//not a comment' }
+ ]
+ ].each do |example, expected|
+ MultiJson.decode(example).should == expected
+ end
+ end
end
end

0 comments on commit 8d23336

Please sign in to comment.