rubinius/rubinius — pull request #2763 by pH14 (2013-11-02 05:32:32+00:00)
Title: Add spec for String#match calling Regexp#match

I've added in two tests to check that Rubinius's String#match behavior matches the spec. In MRI, String#match creates a Regexp object and delegates to that object's Regexp#match function, but Rubinius bypasses creating the Regexp object entirely. This leads to divergent behavior if the Regexp#match function is modified but String#match is called.

Spec for convenience: http://ruby-doc.org/core-2.0.0/String.html#method-i-match

Running tests under MRI 2.0.0 and then rbx2.1.1 example: https://gist.github.com/pH14/7275834

Simple example: https://gist.github.com/pH14/7275913

My environment: Darwin pwh-argon.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64