def record_api_methods
      before do
        stub_const("Flickr::Client::Data", Class.new(Flickr::Client::Data) do
          def do_request(http_method, flickr_method, params = {})
            VCR.use_cassette(flickr_method) { super }
          end
        end)

        stub_const("Flickr::Client::Upload", Class.new(Flickr::Client::Upload) do
          def do_request(http_method, path, params = {})
            if VCR.send(:cassettes).empty?
              VCR.use_cassette(path) { super }
            else
              super
            end
          end
        end)
      end
    end
def record_api_methods
      before do
        stub_const("Flickr::Client::Data", Class.new(Flickr::Client::Data) do
          def do_request(http_method, flickr_method, params = {})
            VCR.use_cassette(flickr_method) { super }
          end
        end)

        stub_const("Flickr::Client::Upload", Class.new(Flickr::Client::Upload) do
          def do_request(http_method, path, params = {})
            if VCR.send(:cassettes).empty?
              VCR.use_cassette(path) { super }
            else
              super
            end
          end
        end)
      end
    end
Wraps a VCR cassette around API calls with the same name as the Flickr
 method called. For example, the cassette for `Flickr.sets.create` will
 be called "flickr.photosets.create". Because we repeat the same API calls
 in different examples, we can just reuse those VCR cassettes rather than
 recording new ones.