summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-02-04 16:42:22 +0100
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-02-04 16:42:22 +0100
commitdfe12649f64bcac76b270a96be04285bbe0c2aa2 (patch)
treee98dc2bb6d887f8c904a5082748f9f9a5a1bafd3 /spec/lib
parentd9624bb87aa6a1ad505cbb0541489c88ae662e44 (diff)
parent4105f292e1c9d9c9416914fcd41f9c982b4a80fb (diff)
downloadgitlab-ce-dfe12649f64bcac76b270a96be04285bbe0c2aa2.tar.gz
Merge remote-tracking branch 'origin/rs-database-info'
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/database_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb
index 8461e8ce50d..bd8688fefa1 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -14,4 +14,24 @@ describe Gitlab::Database, lib: true do
it { is_expected.to satisfy { |val| val == true || val == false } }
end
+
+ describe '.version' do
+ context "on mysql" do
+ it "extracts the version number" do
+ allow(described_class).to receive(:database_version).
+ and_return("5.7.12-standard")
+
+ expect(described_class.version).to eq '5.7.12-standard'
+ end
+ end
+
+ context "on postgresql" do
+ it "extracts the version number" do
+ allow(described_class).to receive(:database_version).
+ and_return("PostgreSQL 9.4.4 on x86_64-apple-darwin14.3.0")
+
+ expect(described_class.version).to eq '9.4.4'
+ end
+ end
+ end
end