[ next ] [ prev ] [ contents ] [ up to Test Number Three -- Tying the Knot ] XP-Cinti TDD Workshop

Adding Method tie

We add the tie method to the body of the Net class. For the moment, we will leave the implementation empty.

# file: net.rb
class Net
  def untied?(x,y)
    true
  end

  def tie(x,y)
  end
end

Time to run the tests.

  
$ ruby testnet.rb
Loaded suite testnet
Started...
..
Failure occurred in test_tie(TestNet) [testnet.rb:15]: Expected <false> but was <true>
.
Finished in 0.055171 seconds.
2 runs, 2 assertions, 1 failures, 0 errors

Now tie is defined, but untied? is returning the wrong value. Let us fix this.


[ next ] [ prev ] [ contents ] [ up to Test Number Three -- Tying the Knot ] Copyright 2003 by Jim Weirich.
Some Rights Reserved