Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move check about PReP boot needed to Partitions module
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env rspec | ||
|
||
require_relative "spec_helper" | ||
|
||
Yast.import "Partitions" | ||
Yast.import "Arch" | ||
|
||
describe Yast::Partitions do | ||
subject(:partitions) { Yast::Partitions } | ||
|
||
describe "#prep_boot_needed?" do | ||
before do | ||
allow(Yast::Partitions).to receive(:PrepBoot).and_return(prep_boot) | ||
allow(Yast::Arch).to receive(:board_iseries).and_return(iseries) | ||
end | ||
|
||
context "when PrepBoot is true and machine does not belongs to iSeries" do | ||
let(:prep_boot) { true } | ||
let(:iseries) { false } | ||
|
||
it "returns true" do | ||
expect(partitions.prep_boot_needed?).to eq(true) | ||
end | ||
end | ||
|
||
context "when PrepBoot is false" do | ||
let(:prep_boot) { false } | ||
let(:iseries) { false } | ||
|
||
it "returns false" do | ||
expect(partitions.prep_boot_needed?).to eq(false) | ||
end | ||
end | ||
|
||
context "when PrepBoot is true and machine belongs to iSeries" do | ||
let(:prep_boot) { true } | ||
let(:iseries) { true } | ||
|
||
it "returns false" do | ||
expect(partitions.prep_boot_needed?).to eq(false) | ||
end | ||
end | ||
end | ||
end |