Tag Archives: Test::Unit

How to know if you have a secure session in Watir

Sometimes you’re on a secure page, sometimes you’re not. How to know? There’s a very simple method you can write to find out, based on the browser’s current url. Here’s the method: def is_session_secure? @browser.url =~ /^https/ ? true : … Continue reading

Posted in Example Code, Ruby, Test::Unit, WATIR | Tagged , , , , , , | Leave a comment

How to know your ruby Test::Unit test result

If a test passes, you usually don’t want to know any more – nothing to see here, move along. But, if a test fails or errors, you become far more interested. But… how to know if a test failed or … Continue reading

Posted in Automated Testing, Example Code, Ruby, Test Management, Test::Unit, Tools | Tagged , , , , | Leave a comment

How to print start time in Ruby Test::Unit test run

I want to be able to print a timestamp of the test execution start time. Test::Unit doesn’t seem to be able to do this out-of-the-box, so here’s a monkeypatch I’ve written to put that functionality into-the-box! class Test::Unit::AutoRunner alias original_run … Continue reading

Posted in Automated Testing, Example Code, Making Life Easier, Ruby, Test::Unit, Tools | Tagged , , , , | Leave a comment

How to print test names when executing Ruby Test::Unit tests

When I run my test_all.rb from the command line, I get ‘.’ when a test passes, but I don’t know which test it was that passed. I only get the names of tests that fail or error. Quite sensible – … Continue reading

Posted in Automated Testing, Making Life Easier, Ruby, Test Management, Test::Unit, Tools | Tagged , , , , | Leave a comment

How to run individual Ruby Test::Unit tests

I have a whole load of Test::Unit::TestCase class files. Each one contains a whole load of test_* methods. If I want to run one or two individual test_ methods from a selection of  TestCase classes, how do I do it? … Continue reading

Posted in Automated Testing, Example Code, Ruby, Test::Unit, Tools | Tagged , , , , | Leave a comment

Running NetBeans ruby tests from the command line

As far as doing UI testing with watir/firewatir goes, NetBeans is a fantastic IDE. It’s lightweight, but powerful enough to do pretty much anything I need. The integration with Test::Unit is particularly good: I select a test file, I call … Continue reading

Posted in Automated Testing, Making Life Easier, Ruby, Test::Unit, Tools, WATIR | Tagged , , , , , , | Leave a comment

How to count all Ruby Test::Unit tests

I’m using Ruby’s Test::Unit with Watir and Firewatir for a project I’m working on. Tests are divided up into test classes, each test class being in one file. I then have files that aggregate the test case classes using the … Continue reading

Posted in Automated Testing, Example Code, Ruby, Test::Unit, Tools | Tagged , , , , | Leave a comment