def receive_message(regexp = nil)
      recv = Nokogiri::XML::Node.new 'recv', doc
      recv['request'] = 'MESSAGE'
      scenario_node << recv

      if regexp
        action = Nokogiri::XML::Node.new 'action', doc
        ereg = Nokogiri::XML::Node.new 'ereg', doc

        ereg['regexp'] = regexp
        ereg['search_in'] = 'body'
        ereg['check_it'] = true

        var = "message_#{@message_variables += 1}"
        ereg['assign_to'] = var
        @reference_variables << var

        action << ereg
        recv << action
      end

      okay
    end
def receive_message(regexp = nil)
      recv = Nokogiri::XML::Node.new 'recv', doc
      recv['request'] = 'MESSAGE'
      scenario_node << recv

      if regexp
        action = Nokogiri::XML::Node.new 'action', doc
        ereg = Nokogiri::XML::Node.new 'ereg', doc

        ereg['regexp'] = regexp
        ereg['search_in'] = 'body'
        ereg['check_it'] = true

        var = "message_#{@message_variables += 1}"
        ereg['assign_to'] = var
        @reference_variables << var

        action << ereg
        recv << action
      end

      okay
    end
Expect to receive a MESSAGE message

 @param [String] regexp A regular expression (as a String) to match the message body against