class Tryouts
def tryout(name, dtype=nil, command=nil, &block)
* +b+ is a block definition for the Tryout. See Tryout#from_block
* +command+ when type is :cli, this is the name of the Rye::Box method that we're testing. Otherwise ignored.
* +type+ is the default drill type for the Tryout. One of: :cli, :api
* +name+ is the name of the Tryout
Create a new Tryout object and add it to the list for this Tryouts class.
def tryout(name, dtype=nil, command=nil, &block) return if name.nil? dtype ||= @dtype command ||= @command if dtype == :cli raise "No drill type specified for #{name}." if dtype.nil? to = find_tryout(name, dtype) if to.nil? to = Tryouts::Tryout.new(name, dtype, command) @tryouts[name] = to end # Process the rest of the DSL begin to.from_block block if block rescue SyntaxError, LoadError, Exception, TypeError, RuntimeError, NoMethodError, NameError => ex @errors << ex Tryouts.failed = true end to end