jmespath / jmespath/jmespath.rb

rspec testsuite fails with ruby4.0.0dev 2025-11-24

Open
#63 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
167
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Beginning with this ruby4.0.0dev commit:
https://github.com/ruby/ruby/commit/c7a84ae0bb8c6dab3463076d7e5ca9b6f89880f4

(Or for ruby/json: beginning with this commit:
https://github.com/ruby/json/commit/4f4551f993bf1642eb8e0a18152306c5b25b18ea
)

jmespath git head ( https://github.com/jmespath/jmespath.rb/commit/5e86ea7da2e954cc12f5b3a8383a43c0a65acba7 )
rspec testsuite fails like:

```
An error occurred while loading ./spec/compliance_spec.rb.
Failure/Error:
describe("Given #{scenario['given'].to_json}") do
scenario['cases'].each do |test_case|
if test_case['error']

it "the expression #{test_case['expression'].inspect} raises a #{test_case['error']} error" do
error_class = case test_case['error']
when 'runtime' then JMESPath::Errors::RuntimeError
when 'syntax' then JMESPath::Errors::SyntaxError
when 'invalid-type' then JMESPath::Errors::InvalidTypeError
when 'invalid-value' then JMESPath::Errors::InvalidValueError

JSON::GeneratorError:
source sequence is illegal/malformed utf-8
# ./spec/compliance_spec.rb:12:in 'JSON::Ext::Generator::GeneratorMethods::Hash#to_json'
# ./spec/compliance_spec.rb:12:in 'block (4 levels) in '
# ./spec/compliance_spec.rb:11:in 'Array#each'
# ./spec/compliance_spec.rb:11:in 'block (3 levels) in '
# ./spec/compliance_spec.rb:10:in 'block (2 levels) in '
# ./spec/compliance_spec.rb:5:in 'Array#each'
# ./spec/compliance_spec.rb:5:in 'block in '
# ./spec/compliance_spec.rb:4:in ''

An error occurred while loading ./spec/implicit_conversion_spec.rb.
Failure/Error:
describe("Given #{scenario['given'].to_json}") do
scenario['cases'].each do |test_case|
next if test_case['error']
it "searching #{test_case['expression'].inspect} returns #{test_case['result'].to_json}" do
result = JMESPath.search(test_case['expression'], Wrapper.wrap(scenario['given']))

expect(JMESPath::Util.as_json(result)).to eq(test_case['result'])
end
end
end

JSON::GeneratorError:
source sequence is illegal/malformed utf-8
# ./spec/implicit_conversion_spec.rb:65:in 'JSON::Ext::Generator::GeneratorMethods::Hash#to_json'
# ./spec/implicit_conversion_spec.rb:65:in 'block (5 levels) in '
# ./spec/implicit_conversion_spec.rb:64:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:64:in 'block (4 levels) in '
# ./spec/implicit_conversion_spec.rb:63:in 'block (3 levels) in '
# ./spec/implicit_conversion_spec.rb:58:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:58:in 'block (2 levels) in '
# ./spec/implicit_conversion_spec.rb:57:in 'block in '
# ./spec/implicit_conversion_spec.rb:37:in ''
# ./spec/implicit_conversion_spec.rb:36:in ''

Finished in 0.00007 seconds (files took 0.5614 seconds to load)
0 examples, 0 failures, 2 errors occurred outside of examples
```

`spec/compliance/identifiers.json` is failing (if I remove this json file, rspec testsuite passes).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.