class Tryouts::Tryout

def dream(dname, output=nil, format=nil, rcode=0, emsg=nil, &definition)

NOTE: This method is DSL-only. It's not intended to be used in OO syntax.

+definition+ is a block which will be run on an instance of Dream
+output+ A String or Array of expected output. A Dream object will be created using this value (optional)
+name+ of the Drill associated to this Dream
def dream(dname, output=nil, format=nil, rcode=0, emsg=nil, &definition) 
  raise "Empty dream name (#{@name})" if dname.nil? || dname.empty?
  if output.nil?
    raise "No output or block for '#{dname}' (#{@name})" if definition.nil?
    dobj = Tryouts::Drill::Dream.from_block definition
  else
    dobj = Tryouts::Drill::Dream.new(output)
    dobj.format, dobj.rcode, dobj.emsg = format, rcode, emsg
  end
  @dreams[dname] = dobj
  dobj
end