[Nitro] [PATCH][FIX] fix-nitro-compiler-param-processing

Jonathan Buch john at oxyliquit.de
Sat Apr 29 05:59:13 EDT 2006


Hi,

> Attached adds a test case for, and seems to fix the problem of,
> incorrect number of arguments when calling Nitro actions, reported by
> Massimo on the mailing list
> (http://rubyforge.org/pipermail/nitro-general/2006-April/004106.html)
> and Kashia on irc. I didn't have time to try it in an app (it's after
> midnight for me here) but I thought I'd throw it out anyway.
>
> * fix-nitro-compiler-param-processing

Yay for Bryan :D

Tested it with Oxy:

ERROR -- : Error while handling '/add/question'.
ERROR -- : wrong number of arguments (0 for 1)

It now seems to swallow more arguments than it's supposed to.

assert_match(/#{params}/, get(:uri => '/test', :params => { 'params' =>  
'1', 'arg2'=>'2' }))

this line fails with

<"arg1=&arg2="> expected to be =~ </arg1=1&arg2=2/>.

in the unit tests.

Which I find weird. Since it runs the other two asserts just fine. (I
just uncommented that line.) My case ('/add/question') should be handled
by the other test-cases, but it seems it isn't.

I added another test function:
     def test3(arg); "arg=#{arg}"; end
and another assert:
     assert_match(/arg=1/, post(:uri => '/test3/1'))
result:
     <"arg1=1&arg2=2"> expected to be =~ </arg=1/>.

I also doubt about the usefulness of this assert:
     assert_match(/#{params}/, get(:uri => '/test2/1/2'))

the test2() function doesn't accept any arguments, so why doesn't the
assert fail?

I just realized... the "return value" doesn't get reset, even when
running the next assert/get(:uri..). Thats why the test2 test doesn't
fail like it should.

running a single assert gives the real return value, the test2 does
indeed fail.

Hmm.. too bad I don't get any of this parameter handling stuff.. I hope
that my mail helps you a bit, bryan.

Kashia

-- 
Feel the love
http://pinkjuice.com/pics/ruby.png



More information about the Nitro-general mailing list