Skip to content

Commit

Permalink
Delete JSON spec for recursive hashes (#952)
Browse files Browse the repository at this point in the history
The `JSON` 2.3.0 gem changed how parsing errors are raised. For example:

    require 'json'
    data = {}
    data['cycle'] = data
    JSON.dump(data)

With json v2.2.0:
This raises a `SystemStackError`.

With json v2.3.0:
This causes `fatal (machine stack overflow in critical region)`

Since the specs depend on 'SystemStackError' removing.
  • Loading branch information
ksylvest committed Mar 2, 2020
1 parent 2e4378d commit fa3aa4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -14,6 +14,7 @@ rvm:
- 2.4.9
- 2.5.7
- 2.6.5
- 2.7.0

env:
- RAILS_VERSION=4
Expand Down
15 changes: 0 additions & 15 deletions spec/raven/json_spec.rb
Expand Up @@ -60,20 +60,5 @@
JSON.parse(%({"example": "this is a utf8 or ASCII string"}).encode("US-ASCII"))
end.not_to raise_error
end

it "blows up on circular references" do
data = {}
data['data'] = data
data['ary'] = []
data['ary'].push('x' => data['ary'])
data['ary2'] = data['ary']
data['leave intact'] = { 'not a circular reference' => true }

if RUBY_PLATFORM == 'java'
expect { JSON.dump(data) }.to raise_error
else
expect { JSON.dump(data) }.to raise_error(SystemStackError)
end
end
end
end

0 comments on commit fa3aa4a

Please sign in to comment.