Skip to content

Commit

Permalink
Fix AutoinstPartPlan tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 28, 2016
1 parent 896f287 commit 8876cc7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions test/AutoinstGeneral_test.rb
Expand Up @@ -8,6 +8,17 @@
describe Yast::AutoinstGeneral do
FIXTURES_PATH = File.join(File.dirname(__FILE__), 'fixtures')

let(:default_subvol) { "@" }
let(:filesystems) do
double("filesystems",
default_subvol: default_subvol, read_default_subvol_from_target: default_subvol)
end

before do
allow(Yast).to receive(:import).with("FileSystems").and_return(nil)
stub_const("Yast::FileSystems", filesystems)
end

describe "#ntp syncing in Write call" do
let(:profile_sync) { File.join(FIXTURES_PATH, 'profiles', 'general_with_time_sync.xml') }
let(:profile_no_sync) { File.join(FIXTURES_PATH, 'profiles', 'general_without_time_sync.xml') }
Expand Down
12 changes: 10 additions & 2 deletions test/AutoinstPartPlan_test.rb
Expand Up @@ -10,6 +10,16 @@
describe Yast::AutoinstPartPlan do
let(:target_map_path) { File.join(FIXTURES_PATH, "storage", "nfs_root.yml") }
let(:target_map_clone) { File.join(FIXTURES_PATH, "storage", "target_clone.yml") }
let(:default_subvol) { "@" }
let(:filesystems) do
double("filesystems",
default_subvol: default_subvol, read_default_subvol_from_target: default_subvol)
end

before do
allow(Yast).to receive(:import).with("FileSystems").and_return(nil)
stub_const("Yast::FileSystems", filesystems)
end

describe "#read partition target" do

Expand Down Expand Up @@ -48,11 +58,9 @@

describe "#Export" do
let(:target_map) { YAML.load_file(File.join(FIXTURES_PATH, "storage", "subvolumes.yml")) }
let(:default_subvol) { "@" }

before do
allow(Yast::Storage).to receive(:GetTargetMap).and_return(target_map)
stub_const("Yast::FileSystems", double("filesystems", default_subvol: default_subvol))
Yast::AutoinstPartPlan.Read
end

Expand Down
1 change: 1 addition & 0 deletions test/Makefile.am
Expand Up @@ -9,6 +9,7 @@ TESTS = \
AutoinstConfig_tests.rb \
AutoinstFunctions_test.rb \
AutoinstGeneral_test.rb \
AutoinstPartPlan_test.rb \
AutoinstSoftware_test.rb \
profile_test.rb \
Y2ModuleConfig_test.rb \
Expand Down

0 comments on commit 8876cc7

Please sign in to comment.