Commit 0f627f1c authored by Robert Speicher's avatar Robert Speicher Committed by Dmitriy Zaporozhets

Fix `raise_error` without an argument deprecation warnings

parent 8b1f1ab3
...@@ -14,7 +14,7 @@ describe Gitlab::LDAP::Config do ...@@ -14,7 +14,7 @@ describe Gitlab::LDAP::Config do
end end
it "raises an error if a unknow provider is used" do it "raises an error if a unknow provider is used" do
expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(RuntimeError)
end end
end end
end end
...@@ -28,7 +28,7 @@ describe 'Gitlab::Popen', no_db: true do ...@@ -28,7 +28,7 @@ describe 'Gitlab::Popen', no_db: true do
context 'unsafe string command' do context 'unsafe string command' do
it 'raises an error when it gets called with a string argument' do it 'raises an error when it gets called with a string argument' do
expect { @klass.new.popen('ls', path) }.to raise_error expect { @klass.new.popen('ls', path) }.to raise_error(RuntimeError)
end end
end end
......
...@@ -27,7 +27,7 @@ describe 'Gitlab::Satellite::MergeAction' do ...@@ -27,7 +27,7 @@ describe 'Gitlab::Satellite::MergeAction' do
context 'between branches' do context 'between branches' do
it 'should raise exception -- not expected to be used by non forks' do it 'should raise exception -- not expected to be used by non forks' do
expect { Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).commits_between }.to raise_error expect { Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).commits_between }.to raise_error(RuntimeError)
end end
end end
end end
...@@ -75,7 +75,7 @@ describe 'Gitlab::Satellite::MergeAction' do ...@@ -75,7 +75,7 @@ describe 'Gitlab::Satellite::MergeAction' do
context 'between branches' do context 'between branches' do
it 'should get proper diffs' do it 'should get proper diffs' do
expect{ Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).diffs_between_satellite }.to raise_error expect{ Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).diffs_between_satellite }.to raise_error(RuntimeError)
end end
end end
end end
......
...@@ -14,7 +14,7 @@ describe CommitRange do ...@@ -14,7 +14,7 @@ describe CommitRange do
let(:range2) { described_class.new("#{sha_from}..#{sha_to}") } let(:range2) { described_class.new("#{sha_from}..#{sha_to}") }
it 'raises ArgumentError when given an invalid range string' do it 'raises ArgumentError when given an invalid range string' do
expect { described_class.new("Foo") }.to raise_error expect { described_class.new("Foo") }.to raise_error(ArgumentError)
end end
describe '#to_s' do describe '#to_s' do
......
...@@ -52,7 +52,7 @@ describe ServiceHook do ...@@ -52,7 +52,7 @@ describe ServiceHook do
expect { expect {
@service_hook.execute(@data) @service_hook.execute(@data)
}.to raise_error }.to raise_error(RuntimeError)
end end
end end
end end
...@@ -73,7 +73,7 @@ describe ProjectHook do ...@@ -73,7 +73,7 @@ describe ProjectHook do
expect { expect {
@project_hook.execute(@data, 'push_hooks') @project_hook.execute(@data, 'push_hooks')
}.to raise_error }.to raise_error(RuntimeError)
end end
end end
end end
...@@ -72,13 +72,13 @@ describe API, api: true do ...@@ -72,13 +72,13 @@ describe API, api: true do
it "should throw an error when the current user is not an admin and attempting to sudo" do it "should throw an error when the current user is not an admin and attempting to sudo" do
set_env(user, admin.id) set_env(user, admin.id)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
set_param(user, admin.id) set_param(user, admin.id)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
set_env(user, admin.username) set_env(user, admin.username)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
set_param(user, admin.username) set_param(user, admin.username)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
end end
it "should throw an error when the user cannot be found for a given id" do it "should throw an error when the user cannot be found for a given id" do
...@@ -86,10 +86,10 @@ describe API, api: true do ...@@ -86,10 +86,10 @@ describe API, api: true do
expect(user.id).not_to eq(id) expect(user.id).not_to eq(id)
expect(admin.id).not_to eq(id) expect(admin.id).not_to eq(id)
set_env(admin, id) set_env(admin, id)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
set_param(admin, id) set_param(admin, id)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
end end
it "should throw an error when the user cannot be found for a given username" do it "should throw an error when the user cannot be found for a given username" do
...@@ -97,10 +97,10 @@ describe API, api: true do ...@@ -97,10 +97,10 @@ describe API, api: true do
expect(user.username).not_to eq(username) expect(user.username).not_to eq(username)
expect(admin.username).not_to eq(username) expect(admin.username).not_to eq(username)
set_env(admin, username) set_env(admin, username)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
set_param(admin, username) set_param(admin, username)
expect { current_user }.to raise_error expect { current_user }.to raise_error(Exception)
end end
it "should handle sudo's to oneself" do it "should handle sudo's to oneself" do
......
...@@ -19,7 +19,7 @@ describe ArchiveRepositoryService do ...@@ -19,7 +19,7 @@ describe ArchiveRepositoryService do
it "raises an error" do it "raises an error" do
expect { expect {
subject.execute(timeout: 0.0) subject.execute(timeout: 0.0)
}.to raise_error }.to raise_error(RuntimeError)
end end
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