summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-08 13:13:56 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-11 08:57:06 +0200
commitb788863c68307cc3f17e5cde92b610821c12816a (patch)
tree27819e5ee9a34f80933d47387edc16b6010180c4 /spec/lib/gitlab
parent3d93ad103b32b71d4af330c17227c23a2a167bae (diff)
downloadgitlab-ce-b788863c68307cc3f17e5cde92b610821c12816a.tar.gz
Remove method call to deprecated method
Given the settings initializer creates Gitaly Storage Settings objects already, the calls to path can be moved to that initializer.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/gitaly_client/storage_settings_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb
new file mode 100644
index 00000000000..c89913ec8e9
--- /dev/null
+++ b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe Gitlab::GitalyClient::StorageSettings do
+ describe "#initialize" do
+ context 'when the storage contains no path' do
+ it 'raises an error' do
+ expect do
+ described_class.new("foo" => {})
+ end.to raise_error(described_class::InvalidConfigurationError)
+ end
+ end
+
+ context "when the argument isn't a hash" do
+ it 'raises an error' do
+ expect do
+ described_class.new("test")
+ end.to raise_error("expected a Hash, got a String")
+ end
+ end
+
+ context 'when the storage is valid' do
+ it 'raises no error' do
+ expect do
+ described_class.new("path" => Rails.root)
+ end.not_to raise_error
+ end
+ end
+ end
+end