[mocha-developer] Changing the value of $?

Anselm Heaton anselm at netuxo.co.uk
Tue Jun 19 09:17:26 EDT 2007


Hi :)

Does anyone know of a way to set the value of $? ?

I have a test which stubs ` ; the call works fine, but then the library 
I am testing checks the value of $? to see if the process terminated 
correctly.
It seems not to be possible to assign $? directly...

For now I do this before my test :
`ls > /dev/null`
Which ensure that $? is zero ; but this is not a very nice way of doing 
it ! If anyone here has a good trick for this, it will be very welcome :)

Thanks,
Anselm

-- 
------------------------------
Netuxo Ltd
a workers' co-operative
providing low-cost IT solutions
for peace, environmental and social justice groups
and the radical NGO sector

Registered as a company in England and Wales. No 4798478
Registered office: 5 Caledonian Road, London N1 9DY, Britain
------------------------------
email office at netuxo.co.uk
http://www.netuxo.co.uk
------------------------------



More information about the mocha-developer mailing list