Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Oct 29, 2018
1 parent 9311cf8 commit 9f7ebe0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/lib/installation/clients/save_y2logs.rb
Expand Up @@ -13,12 +13,13 @@ def main

if ProductFeatures.GetBooleanFeature("globals", "save_y2logs")
target_path = ::File.join(
Yast::Installation.destdir,
Yast::Directory.logdir)
Yast::Installation.destdir,
Yast::Directory.logdir
)

WFM.Execute(Yast::Path.new(".local.bash"),
"/usr/sbin/save_y2logs '#{target_path}/yast-installation-logs.tar.xz'")
WFM.Execute(Yast::Path.new(".local.bash"),
"/usr/sbin/save_y2logs '#{target_path}/yast-installation-logs.tar.xz'")
end
end
end
end
end
12 changes: 7 additions & 5 deletions test/lib/clients/save_y2logs_test.rb
Expand Up @@ -10,13 +10,14 @@

describe "#main" do
let(:bash_path) { Yast::Path.new(".local.bash") }

context "globals/save_y2logs in control.xml is false" do
it "does not save y2logs" do
expect(Yast::ProductFeatures).to receive(:GetBooleanFeature).with("globals", "save_y2logs").and_return(false)
expect(Yast::WFM).not_to receive(:Execute).with(
bash_path,
"/usr/sbin/save_y2logs '/var/log/YaST2/yast-installation-logs.tar.xz'")
bash_path,
"/usr/sbin/save_y2logs '/var/log/YaST2/yast-installation-logs.tar.xz'"
)
client.main
end
end
Expand All @@ -25,8 +26,9 @@
it "saves y2logs" do
expect(Yast::ProductFeatures).to receive(:GetBooleanFeature).with("globals", "save_y2logs").and_return(true)
expect(Yast::WFM).to receive(:Execute).with(
bash_path,
"/usr/sbin/save_y2logs '/var/log/YaST2/yast-installation-logs.tar.xz'")
bash_path,
"/usr/sbin/save_y2logs '/var/log/YaST2/yast-installation-logs.tar.xz'"
)
client.main
end
end
Expand Down

0 comments on commit 9f7ebe0

Please sign in to comment.