summaryrefslogtreecommitdiff
path: root/spec/lib/gitaly
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-02 12:06:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-02 12:06:45 +0000
commitbffcdf9bca11a4d43cc40e3f382f03088d36f7c6 (patch)
treec773436393b7a59b5f6b14388b9fa6402a9bd198 /spec/lib/gitaly
parent259c0cc0c4f8a49001b33d1bee577f4422e16d62 (diff)
downloadgitlab-ce-bffcdf9bca11a4d43cc40e3f382f03088d36f7c6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitaly')
-rw-r--r--spec/lib/gitaly/server_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitaly/server_spec.rb b/spec/lib/gitaly/server_spec.rb
index 12dfad6698d..184d049d1fb 100644
--- a/spec/lib/gitaly/server_spec.rb
+++ b/spec/lib/gitaly/server_spec.rb
@@ -65,4 +65,26 @@ describe Gitaly::Server do
end
end
end
+
+ describe '#expected_version?' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:expected_version, :server_version, :result) do
+ '1.1.1' | '1.1.1' | true
+ '1.1.2' | '1.1.1' | false
+ '1.73.0' | '1.73.0-18-gf756ebe2' | false
+ '594c3ea3e0e5540e5915bd1c49713a0381459dd6' | '1.55.6-45-g594c3ea3' | true
+ '594c3ea3e0e5540e5915bd1c49713a0381459dd6' | '1.55.6-46-gabc123ff' | false
+ '594c3ea3e0e5540e5915bd1c49713a0381459dd6' | '1.55.6' | false
+ end
+
+ with_them do
+ it do
+ allow(Gitlab::GitalyClient).to receive(:expected_server_version).and_return(expected_version)
+ allow(server).to receive(:server_version).and_return(server_version)
+
+ expect(server.expected_version?).to eq(result)
+ end
+ end
+ end
end