From 645c7f9631dc73035ef868977c56ca8f7f5529fc Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 2 Jul 2019 20:23:55 -0700 Subject: Fix order-dependent Gitaly specs failing If `spec/tasks/gitlab/cleanup_rake_spec.rb` preceded any of the Gitaly request specs, it would import the `cleanup.rake` and the global function `limit`. For some reason, the Protobuf implementation would use the global function instead of the getter method. For example: ``` def limit puts "hi" end req = Gitaly::WikiGetAllPagesRequest.new req.send(:limit) hi => nil ``` To fix this problem, access the field value using the [] operator instead. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64006 --- spec/support/matchers/gitaly_matchers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/matchers/gitaly_matchers.rb b/spec/support/matchers/gitaly_matchers.rb index ebfabcd8f24..933ed22b5d0 100644 --- a/spec/support/matchers/gitaly_matchers.rb +++ b/spec/support/matchers/gitaly_matchers.rb @@ -9,6 +9,6 @@ end RSpec::Matchers.define :gitaly_request_with_params do |params| match do |actual| - params.reduce(true) { |r, (key, val)| r && actual.send(key) == val } + params.reduce(true) { |r, (key, val)| r && actual[key.to_s] == val } end end -- cgit v1.2.1