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

Ruby 2.5: Add String#delete_prefix and String#delete_prefix! #4993

Merged
merged 2 commits into from Jan 25, 2018

Conversation

Projects
None yet
2 participants
@ChrisBr
Contributor

ChrisBr commented Jan 20, 2018

@ChrisBr

This comment has been minimized.

Contributor

ChrisBr commented Jan 20, 2018

Please note that the last test in test_delete_prefix! currently fails:

    s = S("ax")
    o = Struct.new(:s).new(s)
    def o.to_str
      s.freeze
      "a"
    end
    assert_raise_with_message(RuntimeError, /frozen/) {s.delete_prefix!(o)}

I'm wondering what I do wrong here as I do a frozen check in delete_prefix!
cc @enebo @headius

ChrisBr added some commits Jan 20, 2018

Add tests for String#delete_prefix and String#delete_prefix!
c&p from 10082360b9124c3eaabfccf4fe10a3640c40a05e.
#4876.
@ChrisBr

This comment has been minimized.

Contributor

ChrisBr commented Jan 25, 2018

@enebo @headius fixed the failing test. The problem was that the modify_check() was called before the freeze call was executed. I moved the modifyCheck() now one line down which fixed it.

@enebo enebo added this to the JRuby 9.3.0.0 milestone Jan 25, 2018

@enebo enebo merged commit a9b3836 into jruby:ruby-2.5 Jan 25, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.0.0 Apr 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment