[ next ] [ prev ] [ contents ] [ up to A Real Test ] XP-Cinti TDD Workshop

Fixing the untied? Method

Again, we flip to the 'net.rb' file and make a minor correction.

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

Ruby Comments: All methods in Ruby return something. If you don't use an explicit return, the method will return the value of the last line of the method. In this case, the last (and only) line in untied? is true.

And another test run ..

  
$ ruby testnet.rb
Loaded suite testnet
Started...
..
Finished in 0.023926 seconds.
1 runs, 1 assertions, 0 failures, 0 errors

Success! Time to go celebrate.


[ next ] [ prev ] [ contents ] [ up to A Real Test ] Copyright 2003 by Jim Weirich.
Some Rights Reserved