Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Aug 22, 2022
1 parent 27013be commit c85c15f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/lib/y2users/linux/users_writer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c85c15f

Please sign in to comment.