summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-05-06 12:08:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-05-06 12:08:39 -0700
commit5608caf7b88cac1a8d1ee11e5283429c7ae9ec44 (patch)
tree2e978754e7a40e04893f5dacc763a2108b0c95d5 /spec
parent4033571e3fd300b7b34d222df9ccd9c3ce2b601e (diff)
downloadffi-yajl-5608caf7b88cac1a8d1ee11e5283429c7ae9ec44.tar.gz
ohai hints files rely on this behavior
Diffstat (limited to 'spec')
-rw-r--r--spec/ffi_yajl/parser_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ffi_yajl/parser_spec.rb b/spec/ffi_yajl/parser_spec.rb
index 60a6e69..e8657d4 100644
--- a/spec/ffi_yajl/parser_spec.rb
+++ b/spec/ffi_yajl/parser_spec.rb
@@ -6,6 +6,11 @@ describe "FFI_Yajl::Parser" do
let(:parser) { FFI_Yajl::Parser.new }
+ it "returns nil for an empty string (compatibility with yajl-ruby)" do
+ json = ''
+ expect { parser.parse(json) }.to be_nil
+ end
+
it "throws an exception when trailing braces are missing" do
json = '{{"foo": 1234}'
expect { parser.parse(json) }.to raise_error(FFI_Yajl::ParseError)