Skip to content

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

Merged
enebo merged 2 commits into
jruby:ruby-2.5from
ChrisBr:feature/string-prefix
Jan 25, 2018
Merged

Ruby 2.5: Add String#delete_prefix and String#delete_prefix!#4993
enebo merged 2 commits into
jruby:ruby-2.5from
ChrisBr:feature/string-prefix

Conversation

@ChrisBr

@ChrisBr ChrisBr commented Jan 20, 2018

Copy link
Copy Markdown
Contributor

@ChrisBr

ChrisBr commented Jan 20, 2018

Copy link
Copy Markdown
Contributor Author

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

ChrisBr commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

@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.

2 participants