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 suite & RUBY_VERSION in code #2540

Closed
1 of 5 tasks
MSP-Greg opened this issue Dec 21, 2018 · 5 comments
Closed
1 of 5 tasks

test suite & RUBY_VERSION in code #2540

MSP-Greg opened this issue Dec 21, 2018 · 5 comments

Comments

@MSP-Greg
Copy link
Contributor

While writing tests for PR #2539, I ran into an issue with the following line in Gem::Util.glob_files_in_dir:

if RUBY_VERSION >= "2.5"

Gem::TestCase has several methods affecting RUBY_VERSION. If util_set_RUBY_VERSION is used in testing and Gem::Util.glob_files_in_dir is called, an error may occur.

There's several ways of working around this issue, so I thought an issue would be best...

This issue is related to:

  • Network problems
  • Installing a library
  • Publishing a library
  • The command line gem
  • Other

Here are my current environment details:

Multiple / RG master

I will abide by the code of conduct.

@bronzdoc
Copy link
Member

Whats the error @MSP-Greg ?

@MSP-Greg
Copy link
Contributor Author

@bronzdoc

Same error as running ruby -e "puts Dir.glob('**/*gemspec', base: Gem.user_dir)" with a version of Ruby less than 2.5, where the keyword argument isn't supported. Since RG is tested on 2.3 & 2.4...

The error is 'TypeError: no implicit conversion of Hash into Integer'

With the tests I wrote, I could get around the issue. The greater issue is when testing modifies the 'appearance' of the Ruby engine/version, etc, code that relies on correctly knowing that fails...

@MSP-Greg
Copy link
Contributor Author

@bronzdoc

Add the following file to test/rubygems, run it under Ruby < 2.5 and Ruby >= 2.5, and you'll see the error generated. As you know, can't attached *.rb files, so a rename is needed...

test_gem_installer_set.rb.txt

@bronzdoc
Copy link
Member

@MSP-Greg this one still an issue for you?

@MSP-Greg
Copy link
Contributor Author

@bronzdoc

I'm here! I was looking at all my open issues...

Sometime ago the RG tests 'converted' to running random. There have been several commits addressing problems with interfering tests (which is the issue here). This issue seems to have been fixed...

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

No branches or pull requests

2 participants