test/support/helpers.rb in aitch-1.0.2 vs test/support/helpers.rb in aitch-1.1.0

- old
+ new

@@ -1,19 +1,20 @@ # frozen_string_literal: true + module Minitest class Test def add_hash_entry(source, target, from, to) target[to] = source[from] if source[from] end def register_uri(http_method, url, options = {}) - body = options.fetch(:body, '') + body = options.fetch(:body, "") status = options.fetch(:status, 200) headers = options.fetch(:headers, {}) - add_hash_entry(options, headers, :location, 'Location') - add_hash_entry(options, headers, :content_type, 'Content-Type') - add_hash_entry(options, headers, :content_encoding, 'Content-Encoding') + add_hash_entry(options, headers, :location, "Location") + add_hash_entry(options, headers, :content_type, "Content-Type") + add_hash_entry(options, headers, :content_encoding, "Content-Encoding") stub_request(http_method, url) .to_return(status: status, body: body, headers: headers) end