|
Running code in DEBUG mode
There will be times when you want to debug code without messing up too many things or stopping production mode.
2 ways of doing this: setting the $DEBUG variable to true inside your code / using the --debug flag in the interpreter and
run the code only if the global $DEBUG is true.
Testing with Test::Unit
The standard method to do unit testing in Ruby is with Test::Unit.
Useful resources:
http://manuals.rubyonrails.com/read/book/5
http://blog.jayfields.com/2006/06/ruby-on-rails-unit-tests.html
http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html
http://nubyonrails.com/articles/2006/08/24/ruby-rails-test-rails-cheat-sheet
http://en.wikibooks.org/wiki/Ruby_Programming/Unit_testing
http://rspec.rubyforge.org/documentation/test_unit.html
ZenTest tools for testing
http://www.linuxjournal.com/article/7776
http://zentest.rubyforge.org/ZenTest/
http://www.zenspider.com/ZSS/Products/ZenTest/
Ruby Debugger
ruby -rdebug filename.rb
How to measure performance of applications with a profiler
ruby -rprofile filename.rb
Windows automation
The Ruby extension WIN32OLE,part of the standard Ruby distribution allows you to use Ruby as a client for Windows automation.
http://homepage1.nifty.com/markey/ruby/win32ole/index_e.html
http://rubyonwindows.blogspot.com/2007/04/ruby-win32ole-inspecting-objects.html
|