How to create a Test Suite in Perl's Test::Unit v0.25

If your Test Case is a package whose goal is to test all aspects of a particular class then a Test Suite is something which kicks off a collection of related Test Cases. As with most things in Perl’s Test::Unit it’s really easy to do and also terribly documented. So, without further ado… You need something to kick off all your tests:

    use Test::Unit::HarnessUnit;
    use My::Test::Suite::Package;

    my $testrunner = Test::Unit::HarnessUnit->new();
    $testrunner->start("My::Test::Suite::Package");

Next you need the test suite it’s going to kick off:


So you want to ride a motorcycle... and not die

Lets be totally clear here. The statistics say that your are roughly as likely to get in an accident while driving a motorcycle as you are while driving a car. The obvious difference being that a car has a safety cage, and a motorcycle has, well… nothing. So, if you have a brain, you’re going to want to take steps to compensate for that missing safety cage. There’s no guarantee any of this will keep you from dying but it’ll seriously increase your chances of survival. For some quick & easy to digest stats on motorcycle safety check out the Gear Up! Project


Kay's incredibly simple Catfish recipe

I’m a big fan of dishes that are easy and fast. One night I was at the store, saw some catfish and decided to buy mysef a fillet. When I got it home I had to find some way to make it interesting with my limited spices. The result has a flavor that very much resembles the physical texture you want to shoot for: lightly seared on the outside that, once breached, reveals a nice soft middle. This will take less than 10 minutes to prepare and cook. Near East makes a sun-dried tomato and rice box that, like everything of theirs, is trivial to make and goes well with this*. We had it with a nice red wine this time but, in retrospect, the flavor is a bit too powerful for wine. Knudsen’s spritzers worked well but I think that the perfect drink for this would be mango juice, although you might want to swap the sun-dried tomato rice with a simpler rice-pilaf if you went that way. If you live near an Indian restaurant you may want to snag some Mango Lassis because this’ll be a little hot. But, neither Miller, nor I, are fans of hot foods and we both like this dish. Ingredients:


LazyWeb Idea: Gravatar + Network of sites = Gravanetric

Pretty much everyone agrees that Gravatar rocks. A global avatar that shows up wherever you make a comment on a blog (sometimes even in your desktop apps). And I don’t think anyone other than naive VC guys wants another “social networking” site, so I’m not going there. But, imagine what would happen if every time you made a comment on a blog that used Gravatars a ping was sent off to the “Gravanetric” servers with two bits of information the hash of your e-mail and the root url of the site you posted too.


Getting just the tip of a Git repo

Sometimes you just want to distribute the source code without its history, and that’s where git-archive comes in. git-archive will create an archive of the files at any point in the history and wrap them all up for you in a tar or zip (defaults to tar). You can even make an archive from a remote repo by using the

—remote=<repo>

option in the administrator has enabled it.

You’ll typically use git-archive like this:


Squeak By Example (first impressions)

I’m reading through Squeak By Example because I’ve got some ideas rumbling around in my head that might be nice to do in Smalltalk. Having an integrated visual environment where everything is an object opens a lot of data visualization possibilities. Anyway, it has been probably two years since I’ve touched Smalltalk, and even then it was pretty brief. So I needed a refresher course.

I’ve been flipping through it looking for random bits of information I was interested in and found them all. Then, I went back and started from the beginning, following all the instructions, doing all the examples…. They’ve done a great job explaining things, it’s really easy to follow, and gives you an excellent step-by-step introduction to Squeak’s IDE, and that’s a very good thing if you’re not familiar with Smalltalk.


Synergy is the Bee's-Knees

Many of us “power users”, especially web developers, have multiple computers on our desks. I have the mac, the linux box, and the windows box. There are good reasons for each, not the least of which is testing browser compatibility. But, Synergy is what makes it not only not-annoying, but freaking cool.

You see my single sweet Kinesis keyboard and funky ergo mouse (neither of which anyone else can successfully use) controls everything. It starts out on the Linux box (on my right, and as i move it left swings over onto the Mac laptop (in the middle, on a pedestal of cool geek books), and as it continues left ends up on the Windows box. The clipboard follows the mouse too (at least it does if you’ve copied text onto it), so I can copy an URL (or whatever) on Windows, mouse right and paste it on the Mac, mouse a little farther and paste it on the Linux box.



Sharing a public Git repo over HTTP [flow chart]

Configuring a public HTTP Git
repository

There is also an SVG version of this flow, which is more readable (but poor IE folks will have issues). Notes: This is a simplest possible configuration. Be sure to check out the docs for git-remote to see how to, optionally, designate specific local or remote branches. Many of the initial commands could be performed locally and then just uploaded to the server. This particular sequence guarantees that all the connection pieces are in place and working correctly.


Where's the "main" repo when using Git?

Sivaram said: “I have been using CVS on and off for a long time; so using git is a bit confusing.

If all the repo clones are equivalent, how does one know one is the ‘clean’ repo? On CVS, there is a centralized repo lying somewhere. I can’t seem to wrap my head around the decentralized model.”

This question trips up a lot of people when they’re introduced to the concept of distributed version control systems. But the answer is exactly the same as in the centralized world. It is wherever the project maintainers tell you it is. Let me give you an example: