From: Emil Sandin Date: 2008-11-07T00:00:15+09:00 Subject: Redefine while Hi, is there an easy way to redefine 'while'. I have a class that uses a while loop. In my unit test it always evaluates to false (which is correct). I only want the loop to run once, and the enter. Just like an if. This is the code I've tried: def while(condition) p "redefined while!" yield if condition end while true do p "hello" sleep 1 end But it loops eternally. Any help? -- Posted via http://www.ruby-forum.com/.