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

TEST: explicitly require stringio #340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtasaka
Copy link

@mtasaka mtasaka commented Nov 8, 2024

Since spec/spec_helper.rb uses StringIO class,
make this file explicitly require stringio.

Since spec/spec_helper.rb uses StringIO class,
make this file explicitly require stringio.
@mtasaka
Copy link
Author

mtasaka commented Nov 8, 2024

Testing with

  • ruby 3.4.0dev (2024-11-07 master df3395f2e3) +PRISM [x86_64-linux] ruby/ruby@df3395f

Executing bson-ruby head
e1f5d8f
rspec testsuite with ~/.spec removed generates the following error:

$ env RUBYLIB=$(pwd)/lib:$(pwd)/ext/bson/ rspec

An error occurred while loading ./spec/bson/array_spec.rb.
Failure/Error:
  class AlternateIO < StringIO
  
    # Read a byte from the stream.
    #
    # @returns [ String ] A String representation of the next byte.
    def readbyte
      super.chr
    end

NameError:
  uninitialized constant StringIO
# ./spec/spec_helper.rb:68:in '<top (required)>'
# ./spec/bson/array_spec.rb:16:in '<top (required)>'


Finished in 0.00055 seconds (files took 2.75 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

With ~/.spec restored, the following error does not happen, perhaps because loading rspec format style somewhere loads stringio internally in rspec. But anyway I think explicitly adding stringio dependency inside bson-ruby is desirable.

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 this pull request may close these issues.

1 participant