Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

intermittent rspec failure on accessing GCR.cassette #4

Open
zben opened this issue Dec 18, 2018 · 0 comments
Open

intermittent rspec failure on accessing GCR.cassette #4

zben opened this issue Dec 18, 2018 · 0 comments

Comments

@zben
Copy link

zben commented Dec 18, 2018

Do you have some clue of how I can fix this error? Have you ever seen this? It's not failing on CI and sometimes fail locally.

NoMethodError:
       undefined method `reqs' for nil:NilClass
     # /Users/benz/.rvm/gems/ruby-2.3.1/gems/gcr-1.0.1/lib/gcr/cassette.rb:109:in `request_response'
  def start_playing
    load

    GCR.stub.class.class_eval do
      alias_method :orig_request_response, :request_response

      def request_response(*args)
        req = GCR::Request.from_proto(*args)
        GCR.cassette.reqs.each do |other_req, resp|
          return resp.to_proto if req == other_req
        end
        raise GCR::NoRecording
      end
    end
  end

I think the class_eval magic might have something to do with it.

@zben zben changed the title intermittent rspec failure on intermittent rspec failure on accessing GCR.cassette Dec 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant