Commit 07e79989 authored by Michael Kozono's avatar Michael Kozono

Reuse `Gitlab::ShellAdapter`

parent 9756deec
module Gitlab module Gitlab
module BackgroundMigration module BackgroundMigration
class UpdateAuthorizedKeysFileSince class UpdateAuthorizedKeysFileSince
include Gitlab::ShellAdapter
class Key < ActiveRecord::Base class Key < ActiveRecord::Base
self.table_name = 'keys' self.table_name = 'keys'
...@@ -34,10 +36,6 @@ module Gitlab ...@@ -34,10 +36,6 @@ module Gitlab
end end
end end
end end
def gitlab_shell
@gitlab_shell ||= Gitlab::Shell.new
end
end end
end end
end end
...@@ -28,7 +28,7 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do ...@@ -28,7 +28,7 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do
end end
it 'calls remove_keys_not_found_in_db on Gitlab::Shell' do it 'calls remove_keys_not_found_in_db on Gitlab::Shell' do
expect(background_migration.gitlab_shell).to receive(:remove_keys_not_found_in_db) expect_any_instance_of(Gitlab::Shell).to receive(:remove_keys_not_found_in_db)
subject subject
end end
end end
...@@ -67,7 +67,7 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do ...@@ -67,7 +67,7 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do
describe '#remove_keys_not_found_in_db' do describe '#remove_keys_not_found_in_db' do
it 'calls remove_keys_not_found_in_db on Gitlab::Shell' do it 'calls remove_keys_not_found_in_db on Gitlab::Shell' do
expect(background_migration.gitlab_shell).to receive(:remove_keys_not_found_in_db) expect_any_instance_of(Gitlab::Shell).to receive(:remove_keys_not_found_in_db)
background_migration.remove_keys_not_found_in_db background_migration.remove_keys_not_found_in_db
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