Docunext


Learning to Build Tests with Ruby

April 24th, 2010

I'm taking a moment to study up on how to build tests with Ruby. I'm taking a step back and starting with some very simple examples, to make sure I have the concepts down cold!


require 'test/unit'

class DoggyTest < Test::Unit::TestCase

    def test_chekit
        assert "hi" == "hi"
    end
    def test_barkit
        assert "bark" == "hi"
    end

end

What do you know? Before I tried this I didn't know that test/unit required methods to be prefixed with "test_" to be auto-run.

You learn something new everyday. I try to, if I can!

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022