/usr/lib/ruby/vendor_ruby/typhoeus/request/stubbable.rb is in ruby-typhoeus 0.6.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | module Typhoeus
class Request
# This module handles stubbing on the request side.
# It plays well with the block_connection configuration,
# which raises when you make a request which is not stubbed.
#
# @api private
module Stubbable
# Override run in order to check for matching expecations.
# When an expecation is found, super is not called. Instead a
# canned response is assigned to the request.
#
# @example Run the request.
# request.run
#
# @return [ Response ] The response.
def run
if response = Expectation.response_for(self)
finish(response)
else
super
end
end
end
end
end
|