Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with Ruby 3.3.1 #51

Closed
ajtucker opened this issue Jun 3, 2024 · 0 comments · Fixed by #52
Closed

Tests fail with Ruby 3.3.1 #51

ajtucker opened this issue Jun 3, 2024 · 0 comments · Fixed by #52

Comments

@ajtucker
Copy link
Contributor

ajtucker commented Jun 3, 2024

Setting .ruby-version to 3.3.1, running make setup and make test results in a test failure:

sapi-client-ruby/lib/sapi_client/hierarchy.rb:5:in `<module:SapiClient>': uninitialized constant SapiClient::OpenStruct (NameError)

  SKOS_SCHEME = OpenStruct.new(
                ^^^^^^^^^^
        from /home/alex/Development/Epimorphics/sapi-client-ruby/lib/sapi_client/hierarchy.rb:3:in `<top (required)>'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from /home/alex/Development/Epimorphics/sapi-client-ruby/lib/sapi_client.rb:20:in `<top (required)>'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from /home/alex/Development/Epimorphics/sapi-client-ruby/test/test_helper.rb:17:in `<top (required)>'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from /home/alex/Development/Epimorphics/sapi-client-ruby/test/sapi_client/application_test.rb:3:in `<top (required)>'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from <internal:/home/alex/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from /home/alex/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>'
        from /home/alex/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select'
        from /home/alex/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Command failed with status (1)

Note that OpenStruct is "officially discouraged" and there are some Ruby3 gotchas about lazy evaluation.

We should add the max Ruby version this works with to spec.required_ruby_version.

@ajtucker ajtucker linked a pull request Jun 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant