SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Dec 4, 2006, 18:49 #1
- Join Date
- Dec 2006
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
intro to ruby unit testing (non-rails)?
I'm a Ruby newbie using Ruby in Steel (Ruby inside Visual Studio IDE, though not a "Ruby.NET". I've made a little progress at starting unit testing with Test::Unit. I know enough about JUnit and NUnit to work out a lot of it.
But I read somewhere on these forums that "TDD is HUGE" in teh Ruby community. Yet I've had trouble finding much beyond vague guidance on using Test::Unit.
Your Resources section onthis forum ought to point any such out if they exist.
thanks,
Chuck
-
Dec 13, 2006, 14:56 #2
- Join Date
- Jul 2004
- Location
- Montreal
- Posts
- 211
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello Chuck,
did you by any change look into the code base for ruby itself? If you look into the lib folder of your ruby installation you'll find (assuming you're using version 1.8) under ruby/1.8/test a file called unit.rb.
This header of this file pretty much gives all the info you want to get started. It might not be a full step by step intro to TDD in Ruby but as you know Nunit and JUnit it should be enough to get you flowing the in the right direction.Jean-Marc (aka Myrdhrin)
M2i3 - blog - Protect your privacy with Zliki
-
Dec 19, 2006, 07:32 #3
- Join Date
- Jul 2004
- Location
- Isle of Dogs
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I would recommend taking a look at <ahref="http://wtr.rubyforge.org/">WATIR</a> it gives you a way to run an automated browser session against your app.
For my money a much more productive use of your testing time than TDD.Server Monitoring Dashboard - Status2K
-
Dec 19, 2006, 12:47 #4
No no no...both are important at different levels. Watir can be used to test your app at a higher, functional level (functional/acceptance testing) - it tests that your app does what it should, but it does *NOT* test your code (lower-level). Not only is TDD about testing your code (i.e. normal unit testing), it is a design methodology too. It helps you write simple, focussed code that does the least necessary to make the tests pass, it helps build up a good regression test suite and it gives confidence when refactoring.
TDD isn't the be all and end all and doesn't work for everybody but unit testing is still very important regardless of whether you practice TDD - its just as important as functional tests.
-
Dec 19, 2006, 13:30 #5
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I used TDD for a while but it doesn't work for me. It's great to test non-trivial code using automated tests. (but most of my code is trivial though).
Last edited by Fenrir2; Dec 19, 2006 at 14:20.
Bookmarks