Skip to content

[ruby-head] Turn value into a String before regex match #2106

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

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

olleolleolle
Copy link
Contributor

@olleolleolle olleolleolle commented Apr 1, 2019

This PR is tries to avoid a warning output in 2.7.0 (ruby-head), which causes a test failure in rspec-core:

expected "/home/travis/build/rspec/rspec-rails/Gemfile-rails-dependencies:49: warning: deprecated Object#=~ is called on FalseClass; it always returns nil\n".empty? to return true, got false

Error in rspec-core Travis build

This PR turns the value (version) being matched with =~ into a String, first.

The change to ruby was introduced in https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=65989&view=revision

@olleolleolle olleolleolle marked this pull request as ready for review April 1, 2019 19:08
@olleolleolle olleolleolle changed the title Turn value into a String before regex match [ruby-head] Turn value into a String before regex match Apr 1, 2019
@olleolleolle olleolleolle force-pushed the try-avoiding-a-ruby-head-thing branch from 3136fd3 to d77f8a7 Compare April 1, 2019 19:22
@olleolleolle
Copy link
Contributor Author

There's also the possibility of defaulting to nil instead of '': NilClass#=~ is defined.

@JonRowe JonRowe merged commit 632901d into rspec:master Apr 2, 2019
@JonRowe
Copy link
Member

JonRowe commented Apr 2, 2019

I'm happy with this as it is now it passes, thanks :)

@olleolleolle olleolleolle deleted the try-avoiding-a-ruby-head-thing branch April 2, 2019 09:00
benoittgt pushed a commit to benoittgt/rspec-rails that referenced this pull request May 1, 2019
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.

2 participants