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

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

Merged
merged 2 commits into from
Jan 25, 2018

Conversation

ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Jan 20, 2018

@ChrisBr
Copy link
Contributor Author

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 ChrisBr force-pushed the feature/string-prefix branch from 5958f36 to 3817407 Compare January 25, 2018 16:08
@ChrisBr
Copy link
Contributor Author

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
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants