Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed May 16, 2016
1 parent 7c49f66 commit 36556ba
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 20 deletions.
2 changes: 2 additions & 0 deletions test/boot_storage_test.rb
Expand Up @@ -108,6 +108,8 @@
"/boot" => ["/dev/vda2"]
)
allow(Yast::Storage).to receive(:GetContVolInfo).and_return(false)
# disable general mock for disk detection
allow(subject).to receive(:detect_disks).and_call_original
end

it "fills RootPartitionDevice variable" do
Expand Down
11 changes: 0 additions & 11 deletions test/bootloader_base_test.rb
Expand Up @@ -30,10 +30,6 @@
end

describe "#read" do
before do
allow(Yast::BootStorage).to receive(:detect_disks)
end

it "detects disks in system" do
expect(Yast::BootStorage).to receive(:detect_disks)

Expand All @@ -50,10 +46,6 @@
end

describe "#propose" do
before do
allow(Yast::BootStorage).to receive(:detect_disks)
end

it "detects disk configuration" do
expect(Yast::BootStorage).to receive(:detect_disks)

Expand Down Expand Up @@ -125,7 +117,6 @@
other = described_class.new
other.define_singleton_method(:name) { "funny_bootloader" }

allow(Yast::BootStorage).to receive(:detect_disks)
other.read

subject.merge(other)
Expand All @@ -137,8 +128,6 @@
other = described_class.new
other.define_singleton_method(:name) { "funny_bootloader" }

allow(Yast::BootStorage).to receive(:detect_disks)

other.propose

subject.merge(other)
Expand Down
1 change: 0 additions & 1 deletion test/bootloader_proposal_client_test.rb
Expand Up @@ -9,7 +9,6 @@
before do
# needed for udev conversion
mock_disk_partition
allow(Yast::BootStorage).to receive(:detect_disks)
allow(Yast::BootStorage).to receive(:mbr_disk).and_return("/dev/sda")
allow(Yast::BootStorage).to receive(:BootPartitionDevice).and_return("/dev/sda1")
allow(Yast::Storage).to receive(:GetTargetMap).and_return({})
Expand Down
1 change: 0 additions & 1 deletion test/bootloader_test.rb
Expand Up @@ -19,7 +19,6 @@ def kernel_line(target)
# clean cache
::Bootloader::BootloaderFactory.instance_variable_set(:@cached_bootloaders, {})
::Bootloader::BootloaderFactory.current_name = "grub2"
allow(Yast::BootStorage).to receive(:detect_disks)
allow(::Bootloader::BootloaderFactory.current).to receive(:read)
end

Expand Down
4 changes: 0 additions & 4 deletions test/grub2_efi_test.rb
Expand Up @@ -59,10 +59,6 @@
end

context "#propose" do
before do
allow(Yast::BootStorage).to receive(:detect_disks)
end

it "proposes to remove pmbr flag for disk" do
subject.propose

Expand Down
2 changes: 0 additions & 2 deletions test/grub2_test.rb
Expand Up @@ -114,8 +114,6 @@
stage1 = double.as_null_object
allow(Bootloader::Stage1).to receive(:new).and_return(stage1)
allow(Bootloader::DeviceMap).to receive(:new).and_return(double.as_null_object)

allow(Yast::BootStorage).to receive(:detect_disks)
end

it "proposes stage1" do
Expand Down
1 change: 0 additions & 1 deletion test/grub2base_test.rb
Expand Up @@ -61,7 +61,6 @@
describe "#propose" do
before do
allow(Yast::BootStorage).to receive(:available_swap_partitions).and_return({})
allow(Yast::BootStorage).to receive(:detect_disks)
end

describe "os_prober proposal" do
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Expand Up @@ -79,5 +79,6 @@ def mock_disk_partition
allow(::Yast::Storage).to receive(:GetTargetMap).and_return({}) # empty target map by default
allow(::Yast::BootStorage).to receive(:underlaying_devices) { |d| [d] }
allow(::Yast::Bootloader).to receive(:checkUsedStorage).and_return(true)
allow(Yast::BootStorage).to receive(:detect_disks) # do not do real disk detection
end
end

0 comments on commit 36556ba

Please sign in to comment.