Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): fix software related tests #1355

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions service/test/agama/dbus/software/product_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@

let(:config) { Agama::Config.new }

let(:target_dir) { Dir.mktmpdir }

before do
stub_const("Agama::Software::Manager::TARGET_DIR", target_dir)
allow(config).to receive(:products).and_return(products)
allow(subject).to receive(:dbus_properties_changed)
allow(Agama::ProductReader).to receive(:new).and_call_original
end

after do
FileUtils.rm_r(target_dir)
end

let(:products) do
Expand Down
7 changes: 7 additions & 0 deletions service/test/agama/software/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
instance_double(Agama::DBus::Clients::Questions)
end

let(:target_dir) { Dir.mktmpdir }

before do
stub_const("Agama::Software::Manager::TARGET_DIR", target_dir)
allow(Yast::Pkg).to receive(:TargetInitialize)
allow(Yast::Pkg).to receive(:TargetFinish)
allow(Yast::Pkg).to receive(:TargetLoad)
Expand All @@ -101,6 +104,10 @@
allow(Agama::ProductReader).to receive(:new).and_call_original
end

after do
FileUtils.rm_r(target_dir)
end

describe "#new" do
before do
allow_any_instance_of(Agama::Software::ProductBuilder)
Expand Down
Loading