Forum: Ruby on Rails Warning: Ambiguous first argument; make sure.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fdb488647484e40f785dde7134afc6d1?d=identicon&s=25 Heinz Strunk (cojones)
on 2008-11-05 22:15
Hello,

I'm getting this warning:

Warning: Ambiguous first argument; make sure.

in my unit test:

assert_match /^[a-zA-Z0-9]+$/, user.username

Does anyone know why or how to change it so it disappears?

Thanks
96146b7a23174e2e024c06a49f845bb8?d=identicon&s=25 Jeffrey L. Taylor (Guest)
on 2008-11-06 16:42
(Received via mailing list)
Quoting Heinz Strunk <rails-mailing-list@andreas-s.net>:
>
> Does anyone know why or how to change it so it disappears?

IIRC, parentheses fix the warning.  I.e.,

assert_match(/^[a-zA-Z0-9]+$/, user.username)

Why it is ambiguous I will leave to someone better in Ruby than I.

HTH,
  Jeffrey
Fdb488647484e40f785dde7134afc6d1?d=identicon&s=25 Heinz Strunk (cojones)
on 2008-12-02 14:54
Thanks!
This topic is locked and can not be replied to.