rubinius/rubinius — pull request #1736 by antekpiechnik (2012-05-19 15:46:18+00:00)
Title: Refactored invalid range validation for String#delete! and String#squeeze!

As suggested by @evanphx here https://github.com/rubinius/rubinius/commit/18352729a19e5f75741596e3d84f1fbb7d2d8f5d

I moved the validation of the input for `String#delete!` and `String#squeeze!` methods into `String#count_table`. This allowed for unification of implementation of those methods across `1.8` and `1.9`. The validation also now has some ruby-version-specific specs. I changed the validation messages to a more specific one, and added validation error message specs away from RubySpec (as suggested by @dbussink).

`String#squeeze!` validation itself was fixed (checking all provided arguments now), for which (and `String#delete!`) I added specific RubySpec specs in separate commits.