From c85c15f51b213066bc1bef3db6d82bf0bd3ea8cf Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Mon, 22 Aug 2022 15:36:52 +0200 Subject: [PATCH] changes from review --- test/lib/y2users/linux/users_writer_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/lib/y2users/linux/users_writer_test.rb b/test/lib/y2users/linux/users_writer_test.rb index 0cc53afe6..239db7f7b 100755 --- a/test/lib/y2users/linux/users_writer_test.rb +++ b/test/lib/y2users/linux/users_writer_test.rb @@ -56,7 +56,8 @@ let(:system_config) { initial_config } before do - allow(Y2Users::Linux::Reader).to receive(:new).and_return(double(read: system_config)) + allow(Y2Users::Linux::Reader).to receive(:new) + .and_return(instance_double(Y2Users::Linux::Reader, read: system_config)) end describe "#write" do @@ -343,8 +344,9 @@ def issues(messages) target_user.authorized_keys = ["new-key"] # cannot overwrite here system_config as we need to have there recent # target user which is modified in `before` code - system_config = Y2Users::Config.new.tap { |c| c.attach([system_user]) } - allow(Y2Users::Linux::Reader).to receive(:new).and_return(double(read: system_config)) + system_config = Y2Users::Config.new.tap { |c| c.attach(system_user) } + allow(Y2Users::Linux::Reader).to receive(:new) + .and_return(instance_double(Y2Users::Linux::Reader, read: system_config)) allow(Yast::FileUtils).to receive(:IsDirectory).with(target_user.home.path) .and_return(true) end