Skip to content

Commit

Permalink
Add unit tests for RemoveAddedRepositories method
Browse files Browse the repository at this point in the history
The commit adds unit tests for RemoveAddedRepositories method of
OneClickInstallWorkerFunctions class.
  • Loading branch information
Oleksandr Orlov committed Apr 16, 2021
1 parent 586b8a9 commit 9176084
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/OneClickInstallWorkerFunctions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,23 @@
end
end
end

describe '#RemoveAddedRepositories' do
context "when metadata cached on disk is removed" do
before do
allow(Yast::Pkg).to receive(:SourceDelete).and_return(true)
end
it "removes added repositories" do
expect(subject.RemoveAddedRepositories).to be true
end
end
context "when metadata cached on disk is NOT removed" do
before do
allow(Yast::Pkg).to receive(:SourceDelete).and_return(false)
end
it "does not remove added repositories" do
expect(subject.RemoveAddedRepositories).to be false
end
end
end
end

0 comments on commit 9176084

Please sign in to comment.