diff --git a/service/test/agama/dbus/software/product_test.rb b/service/test/agama/dbus/software/product_test.rb index e25c36e661..72e1ee7438 100644 --- a/service/test/agama/dbus/software/product_test.rb +++ b/service/test/agama/dbus/software/product_test.rb @@ -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 diff --git a/service/test/agama/software/manager_test.rb b/service/test/agama/software/manager_test.rb index e578508766..f5b7470829 100644 --- a/service/test/agama/software/manager_test.rb +++ b/service/test/agama/software/manager_test.rb @@ -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) @@ -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)