Skip to content

Commit

Permalink
fixed testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Jun 28, 2023
1 parent 093ba2e commit e550753
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/cfa/systemd_boot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,26 @@
describe "#menue_timeout=" do
it "sets the menue_timeout value" do
expect { subject.menue_timeout = "15" }
.to change { subject.menue_timeout }.from("10").to("16")
.to change { subject.menue_timeout }.from("10").to("15")
end
end

describe "#save" do
let(:timeout) { "20" }

before do
allow(Yast::SCR).to receive(:Write)
allow(file_handler).to receive(:read).with(file_path)
.and_return("# Some comment\ntimeout 5")
subject.load
subject.menue_timeout = timeout
end

it "writes changes to configuration file" do
expect(file_handler).to receive(:write)
.with(file_path, /.*timeout #{timeout}.*/)

subject.save
end
end

Expand Down

0 comments on commit e550753

Please sign in to comment.