class Net::SSH::Test::Script

def next(mode=:shift)

event = script.next(:first)
# peek at the next event

event = script.next
# remove the next event and return it

list, by passing :first as the argument.
this can also be used to non-destructively peek at the next event in the
By default, removes the next event in the list and returns it. However,
def next(mode=:shift)
  events.send(mode)
end