[ next ] [ prev ] [ contents ] [ skip to Testing in a Matrix ] XP-Cinti TDD Workshop

Test Number Three -- Tying the Knot

It is time to add more functionality to our program. Lets add the tie and untie methods. We will start with tie. Let's assert that after a call to tie, that untied? at that same location will be false. Our net test now looks like this (I'll omit the rest of 'testnet.rb' for the moment)...

# file: testnet.rb
...
  def test_tie
    net = Net.new
    net.tie(1,1)
    assert_equal false, net.untied?(1,1)
  end
...

Running the tests ...

  
$ ruby testnet.rb
Loaded suite testnet
Started...
..
Error occurred in test_tie(TestNet): NameError: undefined method `tie' for #<Net:0x402168bc>
	testnet.rb:14:in `test_tie'
	testnet.rb:12
.
Finished in 0.05664 seconds.
2 runs, 1 assertions, 0 failures, 1 errors

Ahhh ... the undefined method error again. We know what to do about that.


[ next ] [ prev ] [ contents ] [ skip to Testing in a Matrix ] Copyright 2003 by Jim Weirich.
Some Rights Reserved