mardi 26 mars 2019

rspec failing with error "block (2 levels) in

I'm trying execute some ruby script which involves sending REST calls, but its failing on below error.

An error occurred in an `after(:context)` hook.
NoMethodError: undefined method `logout_curl' for nil:NilClass
occurred at /root/343/auto/G/lib/common/rhelp.rb:110:in `block (2 levels) in <top (required)>'

I have the code block below from rhelp.rb:110

require_relative 'rest_request'
require_relative 'curl_request'    
.
.
.
config.after :all do
    $debug = true
$rest_api.logout_curl
      $curl_request.logout
$root_curl_request.logout
end

And the logout procedure is as below

require_relative 'curl_request'
.
.
.
def logout_curl
@curl_request.logout
end

Please let me know on how to rectify this error. Please note vertical 3 dots means I have only posted snippets.

Aucun commentaire:

Enregistrer un commentaire