Skip to content

Commit

Permalink
Add missing tests for reusable devices issues
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 3, 2017
1 parent 4725d5a commit 4faced0
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/y2storage/autoinst_issues/missing_reusable_device_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env rspec
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require_relative "../../spec_helper"
require "y2storage/autoinst_issues/missing_reuse_info"
require "y2storage/autoinst_profile/partition_section"

describe Y2Storage::AutoinstIssues::MissingReusableDevice do
subject(:issue) { described_class.new(section) }

let(:section) do
instance_double(Y2Storage::AutoinstProfile::PartitionSection)
end

describe "#message" do
it "returns a description of the issue" do
expect(issue.message).to eq("Reusable device not found")
end
end

describe "#severity" do
it "returns :warn" do
expect(issue.severity).to eq(:warn)
end
end
end
45 changes: 45 additions & 0 deletions test/y2storage/autoinst_issues/missing_reuse_info_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env rspec
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require_relative "../../spec_helper"
require "y2storage/autoinst_issues/missing_reuse_info"
require "y2storage/autoinst_profile/partition_section"

describe Y2Storage::AutoinstIssues::MissingReuseInfo do
subject(:issue) { described_class.new(section) }

let(:section) do
instance_double(Y2Storage::AutoinstProfile::PartitionSection)
end

describe "#message" do
it "returns a description of the issue" do
expect(issue.message).to include "Not enough information"
end
end

describe "#severity" do
it "returns :warn" do
expect(issue.severity).to eq(:warn)
end
end
end

0 comments on commit 4faced0

Please sign in to comment.