ffi-yajl 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ac1fd00e6eabc8428f53dafc2368cc654f18fa2
4
- data.tar.gz: 6962689b6508a53174de9c17dfd23b79b0d4163f
3
+ metadata.gz: 106e9a1f39150e1ba6d8c9e8cc89494619cada58
4
+ data.tar.gz: 2d13687a1f4eb651f4fd18078d2662afd6d9d0d9
5
5
  SHA512:
6
- metadata.gz: 46a61715c79b2a639a2932c50af8ef44e5472f53efb8de99e72d758c38fa11307e329ffe3bdf28320a64e43e16d3e42c3cec16c174a352aff64418933b663ecc
7
- data.tar.gz: 4b6bd23a4ac0844e61d5682afa565abcd6961996c9de0e04e1dc461b40ee5f030f5cddb6962bbb79f9804ff3b8947d4d5f554dc4af6e05bb2993b5a9bf23f0a5
6
+ metadata.gz: 26a0c758139e7cfe1d36abec9457baef1ddc886a90c054bb637d52d5df51650cb1c633e9e8dacf702761fdc2c804fda5f11c00398a900b0b4e4a0bc46a4b822e
7
+ data.tar.gz: 7b86b9d4b257be76b21cf1f3c3c59ca3b2dc7ed7f7502be2012961e45b5324d8551ee6368e7d2c2f4d1887dc4dfd4a3380acf8359c28c19b9fd02edeb4195f1c
@@ -16,6 +16,9 @@ module FFI_Yajl
16
16
  # initialization that we can do in pure ruby
17
17
  yajl_opts = {}
18
18
 
19
+ # XXX: bug-compat with ruby-yajl
20
+ return nil if str == ""
21
+
19
22
  # call either the ext or ffi hook
20
23
  do_yajl_parse(str, yajl_opts)
21
24
  end
@@ -1,3 +1,3 @@
1
1
  module FFI_Yajl
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -6,6 +6,11 @@ describe "FFI_Yajl::Parser" do
6
6
 
7
7
  let(:parser) { FFI_Yajl::Parser.new }
8
8
 
9
+ it "returns nil for an empty string (compatibility with yajl-ruby)" do
10
+ json = ''
11
+ expect( parser.parse(json) ).to be_nil
12
+ end
13
+
9
14
  it "throws an exception when trailing braces are missing" do
10
15
  json = '{{"foo": 1234}'
11
16
  expect { parser.parse(json) }.to raise_error(FFI_Yajl::ParseError)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-yajl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lamont Granquist