Rails and testing – where to start?

I came to Rails from PHP world, but I did not create any bigger project in PHP, so for me unit testing was new idea. Maybe not idea, but form with highly automated unit tests was quite new. So I had to start somewhere with tests and I can recommend for all beginners like me to start with manuals.rubyonrails.com/read/book/5. This reading is essential help with starting write own test.

Nice to have plans

But life likes to screw all of them ;-) I had very tight schedule for last few days. I have been sick last few days and was without any will to sit before keyboard. So all my plans turned to be just that – plans ;-) without actions.

Now with vacations closer and closer, probably another delay will occur. You know, you have to be flexible ;-)

Brekpointer

Breakpoints can be very useful, but You have to know how to use it. I’m learning it all the time, and I wish I had more time to do Ruby development. Having for it few hours a week is definitely to low.

Now I give You few tips I’ve learned today…

Output of any command like puts goes to WEBricks log, not to browser neither to irb shell. To see something from such output use client object (think about it as irb-console-client). Like client.puts "Hello!". So we can use it to print variables in a little more friendly way. Lets examine source_lines which is array with current source code. Typing source_lines in irb shell result in something not very readable.

Continue reading

Coffee no more?

Tomorrow it will be three weeks since I’ve stopped drinking coffee. I have planned to do it for test period of month, but today I can already summarize. It was easier than I thought and I encourage all of You to stop drinking coffee. Of course I don’t think about total coffee avoidance (I have two coffees in this period, but it was as social behaviour, not caffeine hunger) only about exiting habit of coffee drinking.

How I do feel without coffee on regular basis? Continue reading