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

Đang mở
#63 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
testing-qa

Hướng nghiên cứu

Chạy bộ kiểm thử RSpec với thay đổi Ruby 4.0.0dev được đề cập và kiểm tra spec/compliance_spec.rb, spec/implicit_conversion_spec.rb cùng spec/compliance/identifiers.json. Truy vết dữ liệu UTF-8 không hợp lệ được JSON::GeneratorError báo cáo, sau đó xác minh rằng toàn bộ bộ kiểm thử được nạp và chạy thành công mà không xóa fixture identifiers.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 <top (required)>'
# ./spec/compliance_spec.rb:11:in 'Array#each'
# ./spec/compliance_spec.rb:11:in 'block (3 levels) in <top (required)>'
# ./spec/compliance_spec.rb:10:in 'block (2 levels) in <top (required)>'
# ./spec/compliance_spec.rb:5:in 'Array#each'
# ./spec/compliance_spec.rb:5:in 'block in <top (required)>'
# ./spec/compliance_spec.rb:4:in '<top (required)>'

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 <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:64:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:64:in 'block (4 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:63:in 'block (3 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:58:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:58:in 'block (2 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:57:in 'block in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:37:in '<module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:36:in '<top (required)>'


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).

Ngôn ngữ chính
Ruby
Star
167
Fork
45
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jmespath/jmespath.rb

Tất cả issue của jmespath/jmespath.rb

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.