class TestSuite

  def runAllTests
    test_methods = []
    self.methods().each do |m|
      if m.to_s =~ /^test*/
        test_methods << m
      end
    end
    
    test_methods.each do |m|
      print "testing #{m}...\t"
      success = self.send(m)
      if success
        puts "Success!"
      else
        puts "Failure!"
      end
    end
  end

  def serialWorking? serial_port
     if serial_port.closed?
       puts "Serial port is closed, can not write to it"
       return false
     end
     true
  end

  def ezservoWorking? ezservo
    status = ezservo.current_status?
    puts "ezservo returned status: #{status}"
    return !(ezservo.has_error)
  end
end
