How to Use ZenTest with Ruby
If you're interested in learning more about refactoring, grab a copy of Refactoring: Improving the Design of Existing Code and take a look at www.refactoring.com. For more information about unit testing, please see c2.com/cgi/wiki?UnitTest www.junit.org/index.htm and www.extremeprogramming.org/rules/unittests.html.
The latest information about Test::Unit and ZenTest can be found on theirs home pages, testunit.talbott.ws and www.zenspider.com/ZSS/Products/ZenTest.
-- -pate http://on-ruby.blogspot.com
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- RSS Feeds
- What's the tweeting protocol?
- New Products
- Trying to Tame the Tablet
- Dart: a New Web Programming Experience
- Reply to comment | Linux Journal
15 hours 26 min ago - Reply to comment | Linux Journal
17 hours 58 min ago - Reply to comment | Linux Journal
19 hours 16 min ago - great post
19 hours 51 min ago - Google Docs
20 hours 13 min ago - Reply to comment | Linux Journal
1 day 1 hour ago - Reply to comment | Linux Journal
1 day 1 hour ago - Web Hosting IQ
1 day 3 hours ago - Thanks for taking the time to
1 day 4 hours ago - Linux is good
1 day 6 hours ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
Concatenate strings with << instead
Avoid concatenating strings using += because it duplicates the receiver string that will remain unused in memory until the GC starts. You should rather use << that modifies the receiver by appending the given string to it. It's also quite faster.
... continuation of the above comment discussing the << operator
(sorry for the truncated comment above) ... You should rather use the double "lower than" operator (cannot be written here or the comment gets cut) that modifies the receiver appending the given string to it and returns the string to allow chained calls. It's also quite faster.
Note that Ryan has moved Zentest to RubyForge...
....right here.
Yours,
Tom
Re: How to Use ZenTest with Ruby
I don't think assert(1) is a good thing. That test should fail, imo. Maybe raising something like NotImplementedError would be better.
A pleasant article, anyway, now I'm wondering how cool an integration of ZenTest with FreeRIDE (and the included Refactoring-Browser plugin) could be..
Re: How to Use ZenTest with Ruby
Great idea for another article or two!
Re: How to Use ZenTest with Ruby
ooh -- ZenTest, rrb, and FreeRIDE together? that sounds really good! Rich, Ryan? are you guys listening?
Re: How to Use ZenTest with Ruby
you can try it yourself :)
I wrote a simple test generation plugin long time ago (see DumbTestBuilder on the FR wiki) in an hour, and I had never used the FreeRIDE/FreeBASE api before..
Re: How to Use ZenTest with Ruby
the assert(1) test set my alarm bells ringing, but I see your point...
Test::Unit is Another Good Reason To Use Ruby, but I always find myself copying an existing testsuite and editing because I cant' remember syntax worth a damn, so anything that bootstraps a test*rb creation is worth its weight in gold..
Re: How to Use ZenTest with Ruby
Excellent. I always wondered what was the easiest way of adding unit tests and what you show here is really simple and straightforward. I love it.
Re: How to Use ZenTest with Ruby
Hey, that's excellent! Thanks for the article.
--Gavin Sinclair
Re: How to Use ZenTest with Ruby
Never used ZenTest before, but it seems like a good way to get started with adding unit testing to those old project I started before I learned how to write decently tested code.
I always like helpers that save me a step or two.
Re: How to Use ZenTest with Ruby
I had never looked into ZenTest, but now that I realize it creates Test::Unit tests for you, it does sound like a great way to deal with legacy (i.e., "not written test-first", in TDD parlance) code.
Re: How to Use ZenTest with Ruby
ZenTest is bidirectional, so it is also a great way to do test-first. Write the tests, run them... throw exceptions galore because the classes referenced do not exist. ZenTest will fill in those blanks for you as well.
Re: How to Use ZenTest with Ruby
Very cool article. I often scan over the code with my eyes and see what I am missing and try to do the refactoring manually. I had never heard of Zentest before this article. I will have to check it out....it looks like it'll make my life easier and less error prone. ;)
Re: How to Use ZenTest with Ruby
Wow! ZenTest looks like a really cool way to generate the unit testing scaffolding code. Looks like it takes the tedium out of unit testing.
Very informative.
It would be great to see more Ruby articles like this as well.
thanks for great article,
thanks for great article, will try zentest
just to point out typo, in last assertion here, no closing paren
def test_name=
aCustomer = Customer.new("Fred Jones")
assert_equal("Fred Jones",aCustomer.name)
aCustomer.name = "Freddy Jones"
assert_equal("Freddy Jones",aCustomer.name
end
can testers use this for functional testing
can testers use this for functional testing?.
(or)
Developers can use it...
pls let me know.if tester can use this, what are the things he wants to know