Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-03 06:23:55 +0300
committerStan Hu <stanhu@gmail.com>2019-07-03 06:33:02 +0300
commit645c7f9631dc73035ef868977c56ca8f7f5529fc (patch)
treec86557bf38e6fb62fe4bf2d083119481494755e3
parent4aa98d31e51ea0f7debdbc160b828a4d3d242884 (diff)
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
-rw-r--r--spec/support/matchers/gitaly_matchers.rb2
1 files changed, 1 insertions, 1 deletions
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