This project is archived and is in readonly mode.

#3103 ✓committed
Jeffrey Hardy

Eliminate Regexp test warnings

Reported by Jeffrey Hardy | August 26th, 2009 @ 07:56 PM

Subvert 'ambiguous first argument' warnings from RegexpExtAccessTests#test_multiline by using assert_equal.

Ruby warns when a Regexp literal with a modifier option is used as an argument to a method without parens.

$ ruby -vwe "puts //m"
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]
-e:1: warning: ambiguous first argument; put parentheses or even spaces
$ ruby -vwe "puts(//m)"
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]

Could also have parenthesized assert(), but that looks ugly.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket


Referenced by