spec/parsing/one_off_spec.rb in yajl-ruby-0.6.3 vs spec/parsing/one_off_spec.rb in yajl-ruby-0.6.4

- old
+ new

@@ -22,14 +22,18 @@ Yajl::Parser.parse(json, :allow_comments => true) }.should_not raise_error(Yajl::ParseError) end it "should not parse invalid UTF8 with :check_utf8 set to true" do - pending "not sure how to write this test yet" + parser = Yajl::Parser.new(:check_utf8 => true) + lambda { + parser.parse("[\"#{"\201\203"}\"]") + }.should raise_error(Yajl::ParseError) end it "should parse invalid UTF8 with :check_utf8 set to false" do - pending "not sure how to write this test yet" + parser = Yajl::Parser.new(:check_utf8 => false) + puts parser.parse("[\"#{"\201\203"}\"]").inspect end it "should parse using it's class method, from an IO" do io = StringIO.new('{"key": 1234}') Yajl::Parser.parse(io).should == {"key" => 1234} \ No newline at end of file