rubinius/rubinius — pull request #1256 by charlietanksley (2011-10-15 00:22:47+00:00)
Title: Update String#squeeze for 19

This patch does what the title says: it makes the String#squeeze spec pass on 1.9. The spec only specified what error should be thrown, so I copied the message that gets thrown from MRI 1.9.2.

This is my first pull request here, and I'm a little unsure about it, so I'm going to be a bit explicit about what I did to make sure I did things correctly. Sorry if this message seems verbose. :)

So that the method would only be implemented in 1.9 (and not mess up the 1.8 behavior), I copied the body of the current String#squeeze method into the `string19.rb` file. After adding code to that to make it throw the appropriate error, I ran `bin/mspec -tx19 spec/ruby/core/string/squeeze_spec.rb` to make sure it worked and then `bin/mspec spec/ruby/core/string/squeeze_spec.rb` and `rake spec` to make sure it didn't break anything. I couldn't tell if there were any other tests I should run to make sure I didn't break anything else, so that I where I stopped.

I'm more than happy to make any changes you'd like to clean this up. I couldn't figure out an elegant way to test whether the sequence was out of order, but I did some up with something that works!