So, I get this warning when I’m running my tests in ruby/RoR
.(eval):289: warning: don’t put space before argument parentheses
I’ve checked every where (but obvoiusly not) and I can’t find the origin of this error.
The above error just pops up inbetween the unit tests …
Can someone clue me in onto how to find the location of this error?
The file and line number are contained in the backtrace. However, in your case, the warning is inside a string being
evaled at runtime. Which means there is no file. (Actually, theevalmethod does take optional arguments for the file name and line number that should be displayed in a backtrace, but in this case whoever wrote the code in question unfortunately forgot to pass those arguments.)I fear that you have no other choice than to manually examine every single call to
evalin your entire codebase, and that includes Rails, your testing framework, your entire application, your tests, your plugins, your helpers, the ruby standard library, …Of course, you should be aware that the problem might not be obvious as in
It could also be something like
Note the difference between the two warning messages: the first one reads exactly like the one you posted, but the second one has the filename instead of
(eval)and the line number inside the file instead of the line number inside the eval string.By the way: the line number
289in the warning message is the line number inside theevald string! In other words: somewhere in your application there is a string beingevald, which is at least 289 lines long! (Actually, it is more likely that this done not in your application but rather in Rails. The Rails router used to be a particularly bad offender, I don’t know if this is still the case.)