Commit 645c7f96 authored by Stan Hu's avatar Stan Hu

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
parent 4aa98d31
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment