Skip to content

Commit

Permalink
Change a test to treat dir:///foo equal to dir:/foo (bsc#1207239)
Browse files Browse the repository at this point in the history
Since Ruby 3.2, URI("dir:///foo").to_s no longer returns "dir:/foo"
It's OK with Zypp, it understands both forms
  • Loading branch information
mvidner committed Feb 14, 2023
1 parent da36e20 commit 240c6bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/pkg_finish_test.rb
Expand Up @@ -271,7 +271,7 @@
context "and the products are also defined in the remote repos" do
let(:remote_products) { [sles_product, sled_product] }

it "removes the fallback repository" do
it "removes the fallback repository" do # HERE 1/2
expect(Yast::Pkg).to receive(:SourceDelete).with fallback_repo.repo_id
client.run
end
Expand All @@ -280,7 +280,7 @@
context "and the products are defined only in the fallback repo" do
let(:remote_products) { [] }

it "removes the fallback repository" do
it "removes the fallback repository" do # HERE 2/2
expect(Yast::Pkg).to receive(:SourceDelete).with fallback_repo.repo_id
client.run
end
Expand Down
15 changes: 10 additions & 5 deletions test/source_dialogs_test.rb
Expand Up @@ -116,17 +116,22 @@ def allow_global_checkbox_state(enabled)

it "uses dir url scheme parameter for local ISO files" do
converted = "iso:///install/openSUSE-13.2-DVD-x86_64.iso"
url = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall"
url_old = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall"
url_new = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2F%2F%2Finstall"

expect(subject.PostprocessISOURL(converted)).to eq(url)
# Since Ruby 3.2, URI("dir:///foo").to_s no longer returns "dir:/foo"
# It's OK with Zypp, it understands both forms
expect([url_old, url_new]).to include(subject.PostprocessISOURL(converted))
end

it "prevents double escaping if get already escaped string" do
converted = "iso:///install/Duomenys%20600%20GB/openSUSE-13.2-DVD-x86_64.iso"
url = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso" \
"&url=dir%3A%2Finstall%2FDuomenys%2520600%2520GB"
url_old = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso" \
"&url=dir%3A%2Finstall%2FDuomenys%2520600%2520GB"
url_new = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso" \
"&url=dir%3A%2F%2F%2Finstall%2FDuomenys%2520600%2520GB"

expect(subject.PostprocessISOURL(converted)).to eq(url)
expect([url_old, url_new]).to include(subject.PostprocessISOURL(converted))
end
end

Expand Down

0 comments on commit 240c6bf

Please sign in to comment.