░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/vendor/bundle/ruby/3.1.0/gems/webmock-3.18.1/test
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: http_request.rb
require 'ostruct' module HttpRequestTestHelper def http_request(method, uri, options = {}) begin uri = URI.parse(uri) rescue uri = Addressable::URI.heuristic_parse(uri) end response = nil clazz = ::Net::HTTP.const_get("#{method.to_s.capitalize}") req = clazz.new("#{uri.path}#{uri.query ? '?' : ''}#{uri.query}", options[:headers]) req.basic_auth uri.user, uri.password if uri.user http = ::Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == "https" response = http.start {|http| http.request(req, options[:body]) } OpenStruct.new({ body: response.body, headers: response, status: response.code }) end end
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 http_request.rb
RB
714 B
2023-09-24 03:48
EDIT
📄 shared_test.rb
RB
4.9 KB
2023-09-24 03:48
EDIT
📄 test_helper.rb
RB
623 B
2023-09-24 03:48
EDIT
📄 test_webmock.rb
RB
411 B
2023-09-24 03:48
EDIT