diff --git a/lib/pact/consumer_contract/interaction_v2_parser.rb b/lib/pact/consumer_contract/interaction_v2_parser.rb index 35dc520..7b66380 100644 --- a/lib/pact/consumer_contract/interaction_v2_parser.rb +++ b/lib/pact/consumer_contract/interaction_v2_parser.rb @@ -38,7 +38,7 @@ def self.parse_request request_hash, options if query_is_string request_hash['query'] = Pact::QueryHash.new(request_hash['query'], original_query_string, Pact::Query.parsed_as_nested?(request_hash['query'])) end - request = Pact::Request::Expected.from_hash(request_hash) + Pact::Request::Expected.from_hash(request_hash) end def self.parse_response response_hash, options diff --git a/lib/pact/consumer_contract/pact_file.rb b/lib/pact/consumer_contract/pact_file.rb index 0345d2b..20c7042 100644 --- a/lib/pact/consumer_contract/pact_file.rb +++ b/lib/pact/consumer_contract/pact_file.rb @@ -35,7 +35,7 @@ def read uri, options = {} def save_pactfile_to_tmp pact, name ::FileUtils.mkdir_p Pact.configuration.tmp_dir ::File.open(Pact.configuration.tmp_dir + "/#{name}", "w") { |file| file << pact} - rescue Errno::EROFS => e + rescue Errno::EROFS # do nothing, probably on RunKit end @@ -56,9 +56,9 @@ def get_local(filepath, _) def get_remote_with_retry(uri_string, options) uri = URI(uri_string) if uri.userinfo - options[:username] = uri.user unless options[:username] - options[:password] = uri.password unless options[:password] - end + options[:username] = uri.user unless options[:username] + options[:password] = uri.password unless options[:password] + end ((options[:retry_limit] || RETRY_LIMIT) + 1).times do |i| begin response = get_remote(uri, options) diff --git a/lib/pact/matching_rules/merge.rb b/lib/pact/matching_rules/merge.rb index 472c83d..fce8e6b 100644 --- a/lib/pact/matching_rules/merge.rb +++ b/lib/pact/matching_rules/merge.rb @@ -42,7 +42,7 @@ def recurse expected, path end def recurse_hash hash, path - recursed = hash.each_with_object({}) do | (k, v), new_hash | + hash.each_with_object({}) do | (k, v), new_hash | new_path = path + "['#{k}']" new_hash[k] = recurse(v, new_path) end diff --git a/lib/pact/term.rb b/lib/pact/term.rb index 0e996e6..143c93f 100644 --- a/lib/pact/term.rb +++ b/lib/pact/term.rb @@ -1,4 +1,5 @@ require 'pact/shared/active_support_support' +Regexp.remove_method(:as_json) if Regexp.method_defined?(:as_json) require 'json/add/regexp' require 'pact/errors'